Chapter:

Recursive-program-in-c

C Program to Find Reverse of a Number using Recursion

Problem Description

This C program finds the reverse of a number using recursion.

Problem Solution

The following C program using recursion reverses the digits of the number and displays it on the output of the terminal. Eg: 123 becomes 321.

Program/Source Code

#include <stdio.h>

#include <math.h>

 

int rev(int, int);

 

int main()

{

    int num, result;

    int length = 0, temp;

 

    printf("Enter an integer number to reverse: ");

    scanf("%d", &num);

    temp = num;

    while (temp != 0)

    {

        length++;

     ....Show More

All Chapters

View all Chapter and number of question available From each chapter from C-programming-