Skip to content

Instantly share code, notes, and snippets.

@ThePratikSah
Created July 17, 2017 17:40
Show Gist options
  • Save ThePratikSah/b9811928888a417c6df61a31716f1bbe to your computer and use it in GitHub Desktop.
Save ThePratikSah/b9811928888a417c6df61a31716f1bbe to your computer and use it in GitHub Desktop.
main() {
int num, digit, rev_num=0;
printf("Enter any number:\n");
scanf("%d", &num);
while(num!=0) {
digit=num % 10;
rev_num=(rev_num*10)+digit;
num=num/10;
}
printf("%d", rev_num);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment