Checkpoint 4.6.1.
What will print?
#include <iostream>
using namespace std;
int main() {
int x = 8;
if (x > 8) {
cout << "One! ";
}
if (x > 6) {
cout << "Two! ";
}
if (x > 3) {
cout << "Three!" << endl;
}
return 0;
}
- One! Two! Three!
- Take a look at the first conditional statement more closely.
- Two! Three!
- 8 is not greater than 8, so it doesn’t meet the first condition.
- Three!
- All of the following are "if" statements, with no return. There are no "else" statements.
- Two!
- All of the following are "if" statements, with no return. There are no "else" statements.
- One!
- Take a look at the first conditional statement more closely.