write a program to input 2 numbers and print their hcf and lcm
Answers
Answered by
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
Math,
2 months ago
Computer Science,
2 months ago
English,
5 months ago
Social Sciences,
11 months ago