Computer Science, asked by hebanoor472, 5 months ago

write a program to input 2 numbers and print their hcf and lcm

Answers

Answered by peehuthakur
5

Answer:

HCF of two numbers in C

int main() { int a, b, x, y, t, gcd, lcm;

printf("Enter two integers\n"); scanf("%d%d", &x, &y);

a = x; b = y;

while (b != 0) { t = b; ...

gcd = a; lcm = (x*y)/gcd;

printf("Greatest common divisor of %d and %d = %d\n", x, y, gcd); ...

return 0

Similar questions