Monday, 17 September 2012

Selection Structure


Selection structures allow the computer to make decisions in your programs. It selects a statement or set of statements to execute on the basis of a condition.

Types:
·        If-else structure
·        Switch structure

If-else structure:
The if-else statement is an extension of the simple if statement. It executes one statement if it is true and other one if condition is false.

Switch structure:
It is used when there are many choices and only one statement is to be executed.

No comments:

Post a Comment