Question:
Accept the Float Value and Precision Value and Print the Float Value According to the Precision Given.
TestCase InputExpected Output
15.87 6
15.870000
12.3 312.300
Answer:
#include<stdio.h>
int main()
{
float num;
int precision;
scanf("%f %d",&num,&precision);
printf("%.*f",num,precision);
return 0;
}
Follow Us for More..
This comment has been removed by a blog administrator.
ReplyDelete