Friday, July 1, 2022

LCM & HCF

#include <stdio.h>
 
int main() {
int a, b, x, y, t, gcd, lcm;
 
printf("Enter two integersn");
scanf("%d%d", &x, &y);
 
a = x;
b = y;
 
while (b != 0) {
t = b;
b = a % b;
a = t;
}
 
gcd = a;
lcm = (x*y)/gcd;
 

return 0;
}
Previous articleFACTORIAL
Next articleREVERSE A NUMBER IN C LANGUAGE
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

CSAT FORMULA BOOK

Only IAS Current Affairs

What is a Polynomial?