| 9 | */ |
| 10 | |
| 11 | int reverse(int num){ |
| 12 | int res = 0; |
| 13 | while(num){ //Until num != 0 |
| 14 | res = res*10 + (num%10); //Continue generating reversed number using last digit of original num in each iteration. |
| 15 | num = num/10; //Removes last digit of original num. |
| 16 | } |
| 17 | return res; //Return the obtained reversed number. |
| 18 | } |
| 19 | int main() |
| 20 | { |
| 21 | jaadu; |
no outgoing calls
no test coverage detected