Q:
Write a C Program to display reverse number and find sum of digits by recursion
belongs to collection: C Number Solved Programs – C Programming
C Number Solved Programs – C Programming
- Write a C Program to check whether number is palindrome or not
- Write a C Program to reverse a number entered by user
- Write a C Program to find Prime numbers between two Limits(Range)
- Write a C Program to display Armstrong numbers between Limits (Range)
- Write a C Program to check whether number is EVEN or ODD
- C Program to find largest number among three numbers
- C Program to display sum of even and product of odd numbers
- Write a C Program to find out the sum of first n numbers
- Write a C Program To find the biggest and smallest number and positions in the given array
- C program to find largest and smallest of three numbers
- Write a C program to find power of a number ( x^n ) using pow function
- Write a C program to calculate difference of two numbers
- Write a C program to find HCF of two numbers
- Write a C program to multiply two numbers using plus operator
- C program to Print Sum and Product of Digits of an integer
- C program to Check whether the Given Number is Prime or not
- C program to Count Number of Digits in a given number
- C program to Find Number of Occurrences of given digit in a number
- C program to Check whether a Number is Perfect Number or not
- C program to check whether a number is Perfect Square or not
- C program to find Sum of Series : 1+2+3+4+….+N using Recursion
- C program to find sum of Series : 1^2+2^2+3^2+4^2+….+N^2
- C Program to find the sum of Series: 1/1!+2/2!+3/3!+4/4!+….+N/N!
- C program to find sum of series: 1+1/2+1/3+1/4+1/5+…..+1/N
- C Program to find sum of series : 1 + 3^2/3^3 + 5^2/5^3 + 7^2/7^3 + … till N terms
- C program to find Sum of series S=1+(1+2)+(1+2+3)+..….+(1+2+3+…+n)
- C Program to find Cosine Series using function cos(x)
- C Program to find Sine Series using Functions Sin(x)
- C Program to Evaluate Exponential Series using Function
- C Program to convert Binary IP address to 32-bit long int
- C Program to Print Natural Numbers in Reverse order
- C Program to Find the Smallest Among Ten Numbers
- C Program to Find the Greatest Among Ten Numbers
- C Program to Evaluate Polynomial using Horner’s method
- C Program to find GCD (HCF) of Three Numbers using Function
- C program find Remainder without using modulus operator
- C Program to Find all Prime Numbers less than N
- Write a C Program to find the perfect numbers below a given number
- C Program to Generate Fibonacci Series using while loop
- C Program to Check whether a Number is Prime or not using For loop
- C program to Add two Complex Numbers using structures
- C program to generate random numbers using rand function
- Write a C program to find nCr and nPr using function
- C program to swap two numbers using third variable
- C program to Swap two numbers without third variable
- C Program to convert decimal number to Binary, Octal or Hexadecimal
- Write a C Program to display reverse number and find sum of digits by recursion
- Write a C Program to convert Number to String using Recursion
- Write a C Program to convert Number to String using Recursion
- Write a C Program to convert string of numbers to an integer using Recursion
Recursion : :
Reverse a number : :
This program reverse the number entered by the user and then prints the reversed number on the screen. For example if user enter 123 as input then 321 is printed as output.
In our program we use modulus(%) operator to obtain the digits of a number. To invert number look at it and write it from opposite direction or the output of code is a number obtained by writing original number from right to left.
To reverse or invert large numbers use long data type or long long data type if your compiler supports it, if you still have large numbers then use strings or other data structure.
Sum of digits : :
This C Program computes the sum of digits in a given integer. This program m accepts integer. Then adds all the digits of a given integer, that becomes the sum of digits of integer.
Below is the source code for C Program to display reverse number and find sum of its digits by recursion which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
OUTPUT : :
need an explanation for this answer? contact us directly to get an explanation for this answer