By | 22.03.2017

# Display reverse number and find sum of digits by recursion

Write a C Program to display reverse number and find sum of its digits using recursion. C program to find sum of digits and reverse of a number. How to find sum of digits of a number and reverse of a number in C programming. Logic to find sum of digits and reverse of a given number in C program.

## Recursion : :

• Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function.
• The C programming language supports recursion, i.e., a function to call itself. But while using recursion, programmers need to be careful to define an exit condition from the function, otherwise it will go into an infinite loop.
• Recursive functions are very useful to solve many mathematical problems, such as calculating the factorial of a number, generating Fibonacci series, etc.

## 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 :

### OUTPUT  : :

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach upto you in the short interval.