I'm trying to compile a program that I created that takes a number and finds its average and reverses it. It's a very simple program, but when I try to compile it with g++, it gives me an error.
Why won't it compile? What code is wrong?
#include <iostream>
using namespace std;
int main ()
{
int num1;
int num2;
int num3;
cout << "Please enter two positive integers with at most four digits each: ";
cin >> num1 >> num2;
cout << "Their average is " << num3 = (num1 * num2) / 2.0;
int rev1;
rev1 = 0
{
num3 * = 10;
num3 += rev1%10;
rev1 /= 10;
}
cout << "The whole part of the average reversed is " << rev1;
}