Question
September 29, 2010 at 10:08 AM
fafdsfs

Aligning output in C ?

by fafdsfs . Updated 15 years, 11 months ago

so here is a screenshot of my program. https://dl.dropbox.com/u/6790139/program.jpg

the output needs to align itself with the decimal point
what code can i use? Is there something in that i can use?

it should look like this:
Average rainfall for month 1: 10.82
Average rainfall for month 2: 12.50
Average rainfall for month 3: 12.05
Average rainfall for month 4: 11.08

and so on….

here is my current output code:
cout << "Average rainfall for month 1: " << fixed << setprecision(2) << jan_avg << endl; and so on...

This discussion is locked

All Comments