C Program to find reverse of a number - c programs
//C Program to find reverse of a number
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int r=0,d,m,n;
printf("Enter a number:");
scanf("%d",&n);
m=n;
do
{
d=m%10;
m= m/10;
r=(r*10)+d;
}
while(m!=0);
#include<conio.h>
void main()
{
clrscr();
int r=0,d,m,n;
printf("Enter a number:");
scanf("%d",&n);
m=n;
do
{
d=m%10;
m= m/10;
r=(r*10)+d;
}
while(m!=0);
printf("%d is the reverse of number\n",r);
}
getch();
}
}
getch();
}
No comments:
Post a Comment