Program to reverse any number

#include<stdio.h>
int main()
{
    int num,r,reverse=0;
 
    printf("Enter any number: ");
    scanf("%d",&num);
 
    while(num){
         r=num%10;
         reverse=reverse*10+r;
         num=num/10;
    }
 
    printf("\nReversed of number: %d",reverse);
    return 0;
}


Output:

Enter any number: 375
Reversed of number: 573

Share this

Related Posts

Dear User,

Thank you for your comment. Hope you like this blog. Kindly share us on Social Media so others can be updated.

-Chief Administrative Officer.