O'Reilly logo

Visual C#® 2012: How to Program, Fifth Edition by Harvey Deitel, Paul Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Answers to Self-Review Exercises

6.1

a) for, while. b) after. c) switch. d) continue. e) && (conditional AND) or & (boolean logical AND). f) false. g) static.

6.2

a) False. The default label is optional. If no default action is needed, then there’s no need for a default label. b) False. You could terminate the case with other statements, such as a return. c) False. Both of the relational expressions must be true for this entire expression to be true when using the && operator. d) True. e) True. f) False. The switch statement does not provide a mechanism for testing ranges of values, so you must list every value to test in a separate case label. g) True.

6.3

a)

sum = 0; for ( count = 1; count <= 99; count += 2 )

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required