Complete Video Learning
Table of Contents
#include<conio.h>
#include<stdio.h>
void main()
{
int n1,n2,a,b,hcf,lcm;
printf("enter the number n1 and n2\n");
scanf("%d%d",&n1,&n2);
a=n1;
b=n2;
while(n1!=n2)
{
if(n1>n2)
{
n1=n1-n2;
}
else
{
n2=n2-n1;
}
}
printf("hcf=%d",n1);
hcf=n1;
lcm=(a*b)/hcf;
printf("lcm=%d",lcm);
getch();
}
enter the number n1 and n2
5
8
hcf=1
lcm=40
SHOW YOUR SUPPORT FOR NIELITBHU..!!
Dear reader, thank you for joining us. Readers like you are an inspiration for us to pursue NIELITBHU. We need your support or cooperation to further empower NIELITBHU and reach NIELITBHU more people in every corner of the country. Your every support is invaluable to our future.