Horje
covertion of decimal into fraction Code Example
covertion of decimal into fraction
 /* IT IA A C CODE COVERT A DECIMAL INT0 NORMAL FRACTION AND MIXED FRACTION*/
      /* EXAMPLE   1.50 ->3/2  ->1 1/2*/

	 #include<stdio.h>
	 void main()
	 {
	 	float f;
	 	
		int n1,n2,e,g,s,h,i;
	 	printf("enter the float value\n");
	 	scanf("%f",&f);
	 	n1=f*100;
	 	n2=100;                                                  
	 	if(n1>n2)
	 		h=n2;
	 	else
	 		h=n1;
	 		
	 		for(i=1;i<=h;i++)
	 			{
	 				if((n1%i==0)&&(n2%i==0))
	 				s=i;
				}
		 e=n1/s;
		 g=n2/s;
		 printf(" normal fraction become %d/%d",e,g);
		 printf("\n");
		 int z=e/g;
		 int y=e%g;
		 int x=e-y;
		 printf(" mixed fraction become %d %d/%d",z,y,x);
		 
	}
                             /* Submitted by akshaykonoor363@gmail.com*/
		




C

Related
HOW TO ADD FORM IN BOOTSTRAp Code Example HOW TO ADD FORM IN BOOTSTRAp Code Example
responsive form bootstrap 4 Code Example responsive form bootstrap 4 Code Example
bootstrap form template Code Example bootstrap form template Code Example
sqlserver insert with set identity Code Example sqlserver insert with set identity Code Example
bootsrap textbox Code Example bootsrap textbox Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10