Program for Reverse the Number


Program for Reverse the Number
#include<stdio.h>
#include<conio.h>
main()
{
int a,r,rev=0;
clrscr();
printf("enter the value of a");
scanf("%d",&a);
while(a!=0)
{
r=a%10;
rev=rev*10+r;

a=a/10;
}
printf("The reverse no of the given no is=%d",rev);
getch();

}

No comments:

Post a Comment