> reverse no program in c ~ Online tutorial

reverse no program in c

REVERSE NUMBER PROGRAME
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,s=0;
clrscr();
printf("\n a= ");
scanf("%d",&a);
while(a>0)
{
a-c=a%10;
printf("%d",c);
s=(s*10)+c;
a=a/10;
}
getch();
}
OUTPUT;
a=1234
c s a
4 0 123
3 4 12
2 43 1
1 432

Answer is 4321//

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: