Score: 0/70%
Question 1:

What is the value of num  after the following code executes if the user enters 10  at the keyboard?

int num;
cin >> num;
 
if (num > 10)
   num -= 10;
else
   num += 10;
Question 2:

What does the following code snippet display if the user enters 70  at the keyboard?

int temperature;
cout << "Enter a temperature: ";
cin >> temperature;
if (temperature < 50);
   cout << "It's cold!" << endl;
if (temperature > 50)
   cout << "It's hot!" << endl;
else
   cout << "Maybe it's raining?"; 
Question 3:

What does the following code snippet display if the user enters 20  at the keyboard?

int favorite;
cout << "Enter your favorite number: ";
cin >> favorite;
if (favorite == 13)
   cout << "That my favorite number too!" << endl;
   cout << "That's amazing!" << endl;
   cout << "Great minds think alike!" << endl;
Question 4:

What will the following code snippet display?

int num = 10;
while (num >= 1)
   cout << num << " ";
   num--;
Question 5:

The while loop is an example of a(n) ________. 

Question 6:

A do-while loop is guaranteed to execute ________.

Question 7:

The for loop has 3 expressions in the following order:

Question 8:

A loop that is located inside another loop is called a(n) ________. 

Question 9:

In order to terminate the execution of a loop, we can use the ________ statement.

Question 10:

If you know ahead of time how many times you need to loop, which loop would you use?