1. ## C Widths help

Ok, im pretty new but am in a fundamentals course. I need help with widths.

So, basically i need to read a int from the user and display it in a column...so something like this.

int gallons;
int gallons1;
int gallons2;

printf( "Enter this quarters usage: " );
scanf( "%d", gallons );
printf( "Enter last quarters usage: " );
scanf( "%d", gallons1 );
printf( etc etc
etc etc
etc etc

what i am looking for, is to be able to take the input and set it say. 15 spaces from the left boarder...its a DOS program, fundamental class. Im not sure how this is suppose to be done, and help is greatly appreciated.

2. Simplest way is to print 15 spaces.

REad up on scanf() - yours are not coded properly.

3. Oh? Are you speaking of me leaving out the '&'? I am aware, i was just submitting in a hurry.

4. Yes. OK.

5. ? im not sure what that did. If i have input from a user, and i want to display it at lets say, 20 spaces from the left right justified. how is this done? Ive only seend this done in for loops and such.

6. The field width

An optional decimal digit string (with non-zero first digit) specifying a minimum field width. If the converted value has fewer characters than the field width, it will be padded with spaces on the left (or right, if the left-adjustment flag has been given). Instead of a decimal digit string one may write '*' or '*m\$' (for some decimal integer m) to specify that the field width is given in the next argument, or in the m-th argument, respectively, which must be of type int. A negative field width is taken as a '-' flag followed by a positive field width. In no case does a non-existent or small field width cause truncation of a field; if the result of a conversion is wider than the field width, the field is expanded to contain the conversion result.