Created
January 4, 2018 11:15
-
-
Save rizwansoaib/fe62362137d1ac514cf09da1067ef6c5 to your computer and use it in GitHub Desktop.
To reverse 5 digit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void main() | |
{ | |
int x; | |
printf("enter 5 digit to reverse"); | |
scanf("%d",&x); | |
int a=x%10; | |
int u=x/10; | |
int b=u%10; | |
int v=u/10; | |
int c=v%10; | |
int w=v/10; | |
int d=w%10; | |
int y=w/10; | |
int e=y%10; | |
int ans=a*10000+b*1000+c*100+d*10+e; | |
printf("%d is reverse of %d",ans,x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To find reverse of 5 digit number