Skip to content

Instantly share code, notes, and snippets.

@mohnoor94
Created August 19, 2017 21:17
Show Gist options
  • Select an option

  • Save mohnoor94/615129a6f86a02cd1c2685459f6f734a to your computer and use it in GitHub Desktop.

Select an option

Save mohnoor94/615129a6f86a02cd1c2685459f6f734a to your computer and use it in GitHub Desktop.
Reverse Positive Integer C++ Function | AbuKhleif
int reverseDigit (int num){
int reversedNumber = 0;
while (num > 0){
int d = num % 10;
reversedNumber = reversedNumber * 10 + d;
num /= 10;
}
return reversedNumber;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment