#include<stdio.h>
void main ()
{
long int num, rev = 0, dig;
clrscr ();
printf (“Enter a Number: “);
scanf (“%ld”, &num);
while(num>0)
{
dig = num % 10;
rev = rev * 10 + dig;
num = num / 10;
}
printf(“Reversed Number is: %ld”, rev);
}
No comments:
Post a Comment