Lesson6-Flow Control Structures
Lesson6-Flow Control Structures
CONCEPTS
a) If….
An If… statement tests a particular condition; if
the condition evaluates to true, a course-of-
action is followed otherwise it is ignored.
Syntax :
If (Boolean expression) {
statements
}
EXAMPLE
Syntax
If (Boolean Expression) {
Statement(s)
}
else{
Statement(s)
}
EXAMPLE
if ( condition_one ) {
statements
}
else if ( condition_two ) {
statement
}
else {
statements
}
EXAMPLE
}while(condition);
CONT…