You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// %.1f will round the decimal points to nearest integer.
// eg: 19.99 will get rounded to 20.00.
// width precision flags
float price1 = 19.99;
float price2 = 1.50;
float price3 = -100.00;
/*printf("%f\n", price1);
printf("%f\n", price2);
printf("%f\n", price3);
*/
printf("%+7.2f\n", price1); // %+7.2f , where %f is th format specifier, + tells the right sign +ve. 7 is the minimum characters to display. .2 is displays 2 decimal points.