//Reverse a number using while loop
#include<stdio.h>
int main()
{
int n,d,rev=0;
printf("Enter n= \n");
scanf("%d",&n);
while(n!=0)
{
d=n%10;
rev=rev*10+d;
n=n/10;
}
printf("Reversed Number = %d",rev);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: