How to separate fractional part from a floating point number?
Solution
#include<stdio.h>
void main()
{
system("clear");
float f,b;
int a;
printf("enter the number in floating point");
scanf("%f",&f);
a=f;
b=f-a;
printf("the integer part is %d \nthe fractional part is %f",a,b);
}
Thanks & Regards,
Anju Soosan George
Assistant Professor
No comments:
Post a Comment