6 Using operators and decision constructs
6.1 Operators
6.1.1 Assignment operators
6.1.2 Arithmetic operators
6.1.3 Relational operators
6.1.4 Logical operators
6.1.5 Operator precedence
6.2 The if, if-else, and ternary constructs
6.2.1 The if construct and its flavors
6.2.2 Missing else blocks
6.2.3 Implications of the presence and absence of {} in if-else constructs
6.2.4 Appropriate versus inappropriate expressions passed as arguments to an if statement
6.2.5 Nested if constructs
6.2.6 Ternary construct
6.3 The switch statement
6.3.1 Create and use a switch statement
6.3.2 Comparing a switch statement with multiple if-else constructs
6.3.3 Arguments passed to a switch statement
6.3.4 Values passed to the label case of a switch statement
6.3.5 Use of break statements within a switch statement
6.4 The for loop
6.4.1 Initialization block
6.4.2 Termination condition
6.4.3 The update clause
6.4.4 Optional parts of a for statement
6.4.5 Nested for loop
6.5 The enhanced for loop
6.5.1 Iteration with enhanced for loop
6.5.2 Limitations of the enhanced for loop
6.5.3 Nested enhanced for loop
6.6 The while and do-while loops
6.6.1 The while loop
6.6.2 The do-while loop
6.6.3 while and do-while block, expression, and nesting rules
6.7 Comparing loop constructs
6.7.1 Comparing do-while and while loops
6.7.2 Comparing for and enhanced for loops
6.7.3 Comparing for and while loops
6.8 Loop statements: break and continue
6.8.1 The break statement
6.8.2 The continue statement
6.8.3 Labeled statements