C program to find LCM of two numbers using recursion

Write a C program to find LCM of two numbers using recursion. How to find LCM of two numbers in C programming using recursion. Logic to find LCM of two numbers using recursion.

Example

Input

Input first number: 12
Input second number: 30

Output

LCM of 12 and 30 = 60

Read more

C program to find GCD (HCF) of two numbers using recursion

Write a recursive function in C to find GCD (HCF) of two numbers. How to find GCD(Greatest Common Divisor) or HCF(Highest Common Factor) of two numbers using recursion in C program. Logic to find HCF of two numbers using recursion in C programming.

Example

Input

Input first number: 10
Input second number: 15

Output

HCF of 10 and 15 = 5

Read more

C program to find sum of digits using recursion

Write a recursive function in C programming to calculate sum of digits of a number. How to calculate sum of digits of a given number using recursion in C program. Logic to find sum of digits using recursion in C programming.

Example

Input

Input number: 1234

Output

Sum of digits: 10

Read more

C program to check palindrome number using recursion

Write a recursive function in C to check palindrome number. How to check whether a number is palindrome or not using recursion in C program. Logic to check palindrome number using recursion in C programming.

Example

Input

Input number: 121

Output

121 is palindrome

Read more

C program to print even or odd numbers in given range using recursion

Write a recursive function in C programming to print all even or odd numbers between 1 to n. How to print all even numbers in given range using recursion in C programming. Logic to print even/odd numbers in given range using recursion.

Example

Input

Input lower limit: 1
Input upper limit: 10

Output

Even numbers between 1 to 10: 2, 4, 6, 8, 10
Odd numbers between 1 to 10: 1, 3, 5, 7, 9

Read more

C program to find sum of natural numbers in given range using recursion

Write a recursive function in C programming to find sum of all natural numbers between 1 to n. How to find sum of all natural numbers using recursion in C program. Logic to find sum of natural numbers in given range using recursion.

Example

Input

Input lower limit: 1
Input upper limit: 10

Output

Sum of natural numbers from 1 to 10 = 55

Read more