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