Saturday, 22 December 2012

C/C++ Program To Calculate LCM and HCM Of Two Numbers


/* C/C++ program to calculate LCM and HCM of two numbers. */

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("Enter two nos : ");
scanf("%d%d",&a,&b);
c=a*b;
while(a!=b)
{
if(a>b)
   a=a-b;
else
   b=b-a;
}
printf("HCM \t= ",a);
printf("LCM \t= ",c/a);
getch();
}

Contact Us ☎ :
+918679370959

.. FEEL FREE TO COMMENT ..
We Are Happy To Help You.

No comments:

Post a Comment