1. ## lining up decimals

I need to line up my input. I am taking type double as my input how could I get the decimalsin line when I output them?

Thanks

2. ## precision

One more thing, is there another type that I can use besides double to get a greater precision(more decimal points)?

3. >>how could I get the decimalsin line when I output them?
do you mean printf format modifiers?

4. I know how to use printf but for example say you input vaules as
32.5
2.3
125.6
1110.3

I need to output them in the following format:

32.5
2.3
125.6
1110.3

where the decimals line up with one another.

Thanks

5. Use the code tags to keep the formating on these boards.

6. printf("Enter a number...");
scanf("%lf" , &n);
[/code]

Need to out put as follows:
32.5
2.3
125.6
1110.3

Is that what you mean?

7. Do this
[code]
Need to out put as follows:
32.5
2.3
125.6
1110.3
[/code]
And you'll get
Code:
Need to out put as follows:
32.5
2.3
125.6
1110.3
... so you can format the output correctly:
Code:
Need to out put as follows:
32.5
2.3
125.6
1110.3
Do this, and tell us what you want again.

8. I need to line up the input by their decimals.
Code:
input as follows:
32.5
2.3
125.6
1110.3
Code:
Need to output as follows:
32.5
2.3
125.6
1110.3

9. Try
printf("%8.1f\n", d);

> is there another type that I can use besides double to get a greater precision
There's long double, but it only adds a few decimal places

If you want more, then you need to resort to an external math package like
GMP

10. printf("%8.1f", n)

Only lets one decimal place be output.

11. Yes I have tried 8.3f and different values.
This only lines up the first digit

12.3
2.3

However I need it to be this.
Code:
12.3
2.3

12. Code:
#include <stdio.h>

int main(void)
{
printf (">%8.3f<\n", 12.3);
printf (">%8.3f<\n", 2.3);
return 0;
}

/*
Program output:

>  12.300<
>   2.300<

*/