The program should invert the number, but for some reason this does not happen
#include <cmath> using namespace std; int main() { int mass[2]; int result = 0; int num; int i = 0; cin >> num; while (num > 0) { mass[i] = num % 10; i++; num = num / 10; } int f = 0; for (int g = sizeof mass - 1; g >= 0; g--) { result = (mass[f] * pow(10, g)) + result; f++; } cout << result << endl; system("pause"); return 0; }