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
scanf("%.2f",&x);
And i think that will solve a problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With