int reverseNumber(int N) {
int reverseN = 0;
while (N > 0) {
reverseN = reverseN * 10 + N % 10;
N /= 10;
}
return reverseN;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
int reverseNumber(int N) {
int reverseN = 0;
while (N > 0) {
reverseN = reverseN * 10 + N % 10;
N /= 10;
}
return reverseN;
}
collect2: error: ld returned 1 exit status