| < Day Day Up > |
|
What characters are used to begin and end compound statements?
How does the if-else statement differ from the if statement?
What control statement can be used in place of nested if-else statements?
Why should a break statement be added to the end of each case of a switch statement?
What’s the purpose of a default case in a switch statement?
What’s the difference between a while and a do-while statement? When would you use a do-while instead of a while statement?
Convert the following while statement to a for statement:
int i = 0; while(i<10){ //do something i++; }
What will happen when the following code executes:
int i = 0; while(i++ < 3){ cout<<"i = "<<i<<endl; break; }
What happens when the following code executes:
int i = 0; while(i < 3){ cout<<"i = "<<i<<endl; continue; i++; }
True/False: Goto statements can be used to jump outside of functions.
| < Day Day Up > |
|