MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/Maths/reverseInteger.cpp:6–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace std;
5
6int main()
7{
8 int n;
9 cin >> n;
10 int rev = 0;
11 while (n != 0)
12 {
13 int rem = n % 10;
14 rev = rev * 10 + rem;
15 n /= 10;
16 }
17 cout << rev << endl;
18 return 0;
19}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected