57. WAP to reverse the digits of given integer.
#include<stdio.h>
void
main()
{
int number,rev=0,r=0;
printf("WAP to reverse the digits
of given integer\n");
printf("Enter the number:");
scanf("%d",&number);
printf("Number :
%d\n",number);
for(;number;number=number/10)
{
r=number%10;
rev=rev*10+r;
}
printf("Reverse Number :
%d\n",rev);
}
Comments
Post a Comment