I know I can use the %20s to reserve 20spaces and print out the string from the left, but how can I do it to reseve the spaces and start filling from the right.
This is how the output is looking
Code:
Name Regular_Pay Overtime_Pay Gross_Pay Tax_Deducted Net_Pay
h 437.50 0.00 437.50 109.38 328.12
Mayr Silver 480.00 0.00 480.00 120.00 360.00
jennifer kahn 540.00 212.62 752.62 188.16 564.47
jacjjg gg 500.00 0.00 500.00 125.00 375.00
jjjjjj jnhroknr popo 400.00 450.00 850.00 212.50 637.50
jjjjjj jnhroknr popf 400.00 450.00 850.00 212.50 637.50
I'm using this to print:
Code:
printf ("%20s %11.2f %11.2f%10.2f %13.2f% 10.2f\n", name, reg_pay, overtm_pay, gross_pay, tax_deduct, net_pay);