I know there is an if there and I can't find any mistakes in the code (although I'm sure there is) in my second project which is a simple math quiz. Someone please help me with how to get rid of the 'else without a previous if' error.
ugh everytime i feel like i am going to finish with no more errors something else happens i have no idea what to do because no knowledge of c++ pretty much.
1 2 3 4 5 6 7 8 9 10
cout << "Question 2 \n";
cout << "What is the six letter acronym for the order of operation? \n";
cin >> operation;
if (operation == "PEMDAS"){
cout >> "Correct \n";
}
return 0;
it says line 39 : no match for 'operator>>' what do i do
your code worked great except for when i answered question 1 wrong, then it just did nothing, it didn't bring up question 2. also what does string operation and answer mean?
1 more problem. when u type something else besides play it says the "we can't start etc" but then it still goes to question 1 is there a way to stop this if the user does not type play? here is my code
urgh idk what is wrong with this i know i spelled pythagorean theorem right bec i copy and pasted into the compiler and it said incorrect. try Q5 etc..
1 2 3 4 5 6 7 8 9 10 11
cout << "Question 4 \n";
cout << "What is the theorem that says a squared + b squared = c squared? (Make sure to capitalize each word.) \n";
cin >> answer;
if (answer == "Pythagorean Theorem") {
cout << "Correct! \n";
}else{
cout << "Incorrect! Try again on Question 5! \n";
}