diff --git a/3-conditionals/17_voting.cpp b/3-conditionals/17_voting.cpp index dec5351..9ebaa34 100644 --- a/3-conditionals/17_voting.cpp +++ b/3-conditionals/17_voting.cpp @@ -8,7 +8,7 @@ int main() { bool citizen = true; bool registered = false; - if (age >= 18 and citizen == true and registered == true) { + if (age >= 18 && citizen == true && registered == true) { // Use '&&' instead of 'and' std::cout << "You can vote!\n"; } else if (age < 18) { diff --git a/3-conditionals/18_trivia_quiz.cpp b/3-conditionals/18_trivia_quiz.cpp index 06e3607..abb3f03 100644 --- a/3-conditionals/18_trivia_quiz.cpp +++ b/3-conditionals/18_trivia_quiz.cpp @@ -10,7 +10,6 @@ int main() { int answer1; int answer2; - std::string answer3; std::cout << "Q1) What is the name of the world's longest river? 💧\n\n"; std::cout << "1) Missouri River\n"; @@ -33,12 +32,14 @@ int main() { std::cout << "3) 206\n"; std::cout << "4) 10\n"; - std::cin >> answer1; + std::cin >> answer2; - if (answer1 == 3) { + if (answer2 == 3) { std::cout << "You got it correct!\n"; } else { std::cout << "I'm sorry...\n"; } + + return 0; }