C PROGRAM TO READ A FLOATING POINT NUMBER AND DISPLAYS THE RIGHT MOST DIGIT OF THE INTEGRAL PART OF THE NUMBER

C PROGRAM TO READ A FLOATING POINT NUMBER AND DISPLAYS THE RIGHT MOST DIGIT OF THE INTEGRAL PART OF THE NUMBER


#include
main()
{
float num;
int ip,rm;
printf(“Enter a floating point number”);
scanf(“%f”,&num);
ip=(int)num;
rm=ip%10;
printf(“Right most digit of integral part=%dn”,rm);
}



1 comment:

  1. the code you have written gives the left most integer . So from which website did you find the solution ?

    ReplyDelete