Hey I just started C++ a few days ago and could use a little help. As stated above my else code is getting the error expected a statement and I cant quite find what i did wrong. I would assume it's the {} but I can't be sure so I thought I would ask for help
#include <iostream>
usingnamespace std;
class number { int number;
};
int main()
{
int number;
cout << "please input a number between 0-100";
cin >> number;
if (number >= 0 && number <=100);
cout << "you entered " << number << endl;
else
{
number = invalid number
cout << " You have entered a " << number << end line;
}
}
#include <iostream>
usingnamespace std;
int main()
{
int number = 0;
cout << "please input a number between 0-100: ";
cin >> number;
if (number >= 0 && number <=100)
cout << "you entered " << number << endl;
else
cout << " You have entered " << number << " which is bad!" << endl;
return 0;
}