Computer Science, asked by adityachoudharya614, 7 months ago

Write a program to accept two numbers and find the HCF and LCM​

Answers

Answered by MuhammdAslam
1

Answer:

C program to find hcf and lcm using recursion

¶long gcd(long, long);

∆int main() { long x, y, hcf, lcm;

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

∆hcf = gcd(x, y); lcm = (x*y)/hcf;

¶printf("Greatest common divisor of %ld and %ld = %ld\n", x, y, hcf); ...

∆return 0; ...

¶long gcd(long a, long b) {

Answered by lahanashrestha905
1

Answer:

Write a program to accept two numbers and find the HCF and LCM​

C program to find hcf and lcm using recursion

long gcd(long, long);

int main() { long x, y, hcf, lcm;

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

hcf = gcd(x, y); lcm = (x*y)/hcf;

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

return 0; ...

long gcd(long a, long b)

Explanation:

Similar questions