Created
January 14, 2025 17:59
-
-
Save MahraibFatima/e273b6bd81596087800548fcab33328f to your computer and use it in GitHub Desktop.
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
int reverseNum(int num){ | |
int reversed_number=0; | |
while(num != 0) { | |
int remainder = num % 10; | |
reversed_number = reversed_number * 10 + remainder; | |
num /= 10; | |
} | |
return reversed_number; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment