# include <stdio.h>
int main ()
{
float value;
printf("Enter float value: ");
scanf("%f", &value);
//print without decimal point
printf("%0.0f\n", value);
//print 1 digits after decimal point
printf("%0.1f\n", value) ;
//print 2 digits after decimal point
printf("%0.2f\n", value) ;
//print 4 digits after decimal point
printf("%0.4f\n", value);
return 0;
}
Program:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer