Skip to content

Instantly share code, notes, and snippets.

@rizwansoaib
Created January 4, 2018 11:15
Show Gist options
  • Save rizwansoaib/fe62362137d1ac514cf09da1067ef6c5 to your computer and use it in GitHub Desktop.
Save rizwansoaib/fe62362137d1ac514cf09da1067ef6c5 to your computer and use it in GitHub Desktop.
To reverse 5 digit
#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);
}
@rizwansoaib
Copy link
Author

To find reverse of 5 digit number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment