Test Your Knowledge: Quiz

Question 5-1. What statements are generally used for conditional branching?

Question 5-2. True or false: an if statement’s condition must evaluate to an expression.

Question 5-3. Why should you use braces when there is only one statement following the if?

Question 5-4. What kind of expression can be placed in a switch statement?

Question 5-5. True or false: you can never fall through in a switch statement.

Question 5-6. Name two uses of goto.

Question 5-7. What is the difference between while and do…while?

Question 5-8. What are the three parts of a for loop header?

Question 5-9. What does the keyword continue do?

Question 5-10. What are two ways to create a loop that never ends until you hit a break statement?

Get Learning C# 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.