SEPARATE FRACTIONAL PART FROM A FLOATING POINT NUMBER - C PROGRAMMING - Code Developer Pro

Breaking

Code Developer Pro

Solutions to all coding problems

Like us on Facebook

test banner

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Thursday, 17 December 2015

SEPARATE FRACTIONAL PART FROM A FLOATING POINT NUMBER - C PROGRAMMING

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

Post Top Ad

Responsive Ads Here