Next: Review Questions Up: The if-else Statement Previous: Summary
Try to answer as many of the following Multi-choice questions as you can.
Do not panic if you make any errors. You can always start again by clicking on the "Restart" button, located at the bottom.
Please enter your full name :
If y has the value 5 what will be the value of the variable y after the following piece of C++ is executed?
y
if (y > 0) y += 2; else y = 3;
Consider the following section of code:
if ( base < height ) cout << "Top heavy structure" << endl; else cout << "Stable structure" << endl;
base
height
Stable structure
Once you have completed all the questions, and are quite happy with your answers. Then click on the "Submit Answers" button.
Clicking the "Restart" button will clear all your answers, ready to re-enter them.