#include <iostream>
int main ();
{
int a;
cout << "What is your age?" << endl;
cin >> a;
if (a < 11)
cout << "You are " << 11 - a << " years younger than me." << endl;
elseif (a > 11)
cout << "You are " << a - 11 << "years older than me." << endl;
else
cout << "You are my age." << endl;
return 0;
}
This is a very simple program. My compiler says that there is something wrong with the first "{". I can't fix it though. Here is the error:
There is an extra semicolon on line 3. Also, cout and endl will not be known identifiers without their namespace qualifications. Insert usingnamespace std; before main.