
/* 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();
}
#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
+918679370959
.. FEEL FREE TO COMMENT ..
We Are Happy To Help You.
We Are Happy To Help You.
No comments:
Post a Comment