Input
Output
#include <stdio.h> void main() { int a=4, b=6, i, j, t, gcd, lcm; printf("Enter two integers: "); printf("%d %d\n", a, b); // input i = a; j = b; while (j > 0) { t = j; j = i % j; i = t; } gcd = i; lcm = (a*b)/gcd; printf("Greatest common divisor(GCD or HCF) of %d and %d is %d\n",a,b,gcd); printf("Least common multiple of %d and %d is %d\n",a,b,lcm); //getch(); }