It just needed a little tweeking...
Code:
#include <iostream>
using namespace std;
int main()
{
int favnum;
int nxt;
cout << "enter a number from 1-100: ";
cin >> favnum;
cout << "you entered: " << favnum << endl;
cout << "now type either a 1 or 2";
cin >> nxt;
if ( nxt == 1 )
{
cout << "your number is 1" << endl;
}
else if (nxt == 2 )
{
cout << "your number is 2" << endl;
}
else
{
cout << "hey, you didn't type 1 or 2! meanie!!!!" << endl;
}
return 0;
}
I'll let you find the changes it will be a good exercise.