Our social:

C program to reverse a Integer Number

Here is a C program to reverse a Integer Number:




#include <stdio.h>

int main()
{
    int num, reverse;
    printf("Enter a number to reverse it: ");
    scanf("%d",&num);
    reverse = 0;
    while(num!=0){
        reverse = reverse * 10;
        reverse = reverse + num % 10;
        num = num / 10;
    }
    printf("Reverse is: %d",reverse);
    return 0;
}



Hope You LIke It commnt below if you have any doubt.