Wednesday, 3 August 2011

Reverse number


//*********************************************************
//           Prepared By : ASHUTOSH SINGH
//*********************************************************

#include<stdio.h>
#include<conio.h>
void main()
{
int n,m,r=0,d;
clrscr();
printf("\nEnter the number:");
scanf("%d",&n);
m=n;
do
{
d=m%10;
m=m/10;
r=(r*10)+d;
}
while(m!=0);
printf("\n\n\nReverse number is: %d",r);
getch();
}

No comments:

Post a Comment