Reverse a Given number

Reverse a Given number in C Programming

#include
int main()
{
int n, reverse=0, rem;
printf(“Enter an integer: “);
scanf(“%d”, &n);
while(n!=0)
{
rem=n%10;
reverse=reverse*10+rem;
n/=10;
}
printf(“Reversed Number = %d”,reverse);
return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *