Showing posts with label WAP TO REVERSE OF ANY NUMBER USING WHILE LOOP. Show all posts
Showing posts with label WAP TO REVERSE OF ANY NUMBER USING WHILE LOOP. Show all posts

Tuesday, January 4, 2011

REVERSE NUMBER

WAP TO REVERSE OF ANY NUMBER USING WHILE LOOP
void main ()
{
int no,r,res;
clrscr ();
printf ("Enter any value: ");
scanf ("%d",&no);
r=res=0;
while (no>0)
{
r=no%10;
no=no/10;
res=(res*10)+r;
}
printf ("\nReverse is %d",res);
getch ();
}