Possible Duplicate:
Limit floating point precision?
In C language, I need to format a number to 2 digits after the decimal point from user input
For example:
float x ;
printf("Enter number");
Let’s suppose the user enters 4.54234635
I need to print and process in the whole program:
4.54
Thanks advance
The complete list
With the required modification (
scanf("%.2f",&x);in the last entry) will solve your problem