Tuesday, September 7, 2010

Reverse of n Digit number

#include"stdio.h"
#include"conio.h"
void main()
{
 int i,n,a,sum=0,x;

 printf("Enter n Digit Number: ");
 scanf("%d",&n);
 x=n;
 printf("\nReverse of %d number is: ",x);
 for(i=1;i<=n;i++)
 {
   a=n%10;
   n=n/10;
   printf("%d",a);
 }
 printf("%d",n);
 getch();

} 

No comments: