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

C program to print all natural numbers from 1 to n using recursion

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

Example

Input

Input lower limit: 1
Input upper limit: 10

Output

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

Read more

C program to find prime numbers in given range using functions

Write a function in C programming to find prime numbers using function. How to find all prime numbers between two intervals using functions. Display all prime numbers between a given range using function in C programming.

Example

Input

Input lower limit: 10
Input upper limit: 50

Output

Prime numbers between 10-50 are: 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47

Read more

C program to find nth fibonacci term using recursion

Write a recursive function to generate nth fibonacci term in C programming. How to generate nth fibonacci term in C programming using recursion. Logic to find nth Fibonacci term using recursion in C programming.

Example

Input

Input any number: 10

Output

10th Fibonacci term: 55

Read more