#include<stdio.h>
void main()
{
float x,y;
int z,w;
printf("Enter floating point number : x= ");
scanf("%f",&x);
z=(int)x%10;
y=x-(int)x;
w=(int)(y*10);
printf(" \nThe Right-most digit of the integral part of the number %.2f is %d",x,z);
printf(" \nThe Left-most digit of the fractional part of the number %.2f is %d",x,w);
}
void main()
{
float x,y;
int z,w;
printf("Enter floating point number : x= ");
scanf("%f",&x);
z=(int)x%10;
y=x-(int)x;
w=(int)(y*10);
printf(" \nThe Right-most digit of the integral part of the number %.2f is %d",x,z);
printf(" \nThe Left-most digit of the fractional part of the number %.2f is %d",x,w);
}
Enter floating point number : x= 123.75
The Right-most digit of the integral part of the number 123.75 is 3
The Left-most digit of the fractional part of the number 123.75 is 7
No comments:
Post a Comment