If a five digit number is input through the keyboard, write a program to reverse that number.
#include <stdio.h>
#include <conio.h>
void main ( )
{
int md, no;
clrscr ( );
printf ("\n\t Enter a five digit number (less than 32767)......:"); scanf ("%d",&no);
printf ("\n\t Reverse number.....:");
while ( no > 0 )
{
md = no % 10;
no = no /10;
printf ("%d",md);
}
getch ( );
}
No comments:
Post a Comment