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, August 28, 2007

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 ();

}