Looping and Branching Constructs
If-else
if ( boolean-expression )
statement1;
[ else
statement2; ]
Switch-case
switch ( int-value ) {
case int-value1:
break;
case int-value2:
break;
default:
}
while
[initialization]
while ( boolean-expression ) {
[statements]
[iteration]
}
for loops
for ([initialization];
[ boolean-expression ];
[iteration]) {
[statements]
}
Previous slide
Next slide
Back to first slide
View graphic version