Commit 88687ea2 authored by Karine's avatar Karine

exercise_06_31, version2

parent 3559a37f
#include <iostream>
int reverse(const int number)
int
reverse(const int number)
{
int copy = number;
int numberCopy = number;
int reversed = 0;
while(copy > 0) {
int reminder = copy % 10;
while (numberCopy > 0) {
int reminder = numberCopy % 10;
reversed = reversed * 10 + reminder;
copy /= 10;
numberCopy /= 10;
}
return reversed;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment