Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3-conditionals/17_voting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 4 additions & 3 deletions 3-conditionals/18_trivia_quiz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
}