#include<stdio.h>
int main()
{
float x=12.25;
int y=x,c=0;
float d = x-y;
for(; x !=((int)x);x = x*10)
{
c++;
}
while(c>0)
{
d=d*10;
c--;
}
printf("%d",y+(int)d);
}
int main()
{
float x=12.25;
int y=x,c=0;
float d = x-y;
for(; x !=((int)x);x = x*10)
{
c++;
}
while(c>0)
{
d=d*10;
c--;
}
printf("%d",y+(int)d);
}
No comments:
Post a Comment