Monday, 19 October 2015

C program to reverse a number

#include<stdio.h>
#include<conio.h>
void main()
{
int x,r;
clrscr();
printf("enter a no :");
scanf("%d",&x);
while(x!=0)
{
r=x%10;
printf("%d",r);
x=x/10;
}
getch();
}

No comments:

Post a Comment