R4R
Right Place For Right Person TM
 
R4R C C ExamplesPrint The Reverse Number Using C
previous

Home

Next

Learn C with example

Print The Reverse Number Using C

In this example we are going to take a number from keyboard and then reverse this number.

 

 

 

Source Code of Example

/*print the reverse no*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,r=0,p;
clrscr();
printf("enter the number\t");
scanf("%d",&a);
while(a!=0)
{
p=a%10;
r=r*10+p;
a=a/10;
}
printf("Reversr number is=%d",r);
getch();
}

Output Of Example

enter the number 123
Reversr number is=321
previous

Home

Next

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R