1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include<stdio.h> int main() { int a, b, x, y, t, hcf, lcm; printf("Enter two integers\n"); scanf("%d%d", &x, &y); a = x; b = y; while (b != 0) { t = b; b = a % b; a = t; } hcf = a; lcm = (x*y)/hcf; printf("Highest Common Factor of %d and %d = %d\n", x, y, hcf); printf("Least common multiple of %d and %d = %d\n", x, y, lcm); return 0; } |

**OUTPUT:**

1 2 3 4 5 | Enter two integers 25 56 Highest Common Factor of 25 and 56 = 1 Least common multiple of 25 and 56 = 1400 |