Based on situations in our daily life , we all take a choice .
Based on a condition in the program , a choice is taken.
if( condition ) // Only if the condition is true , then the program enters the loop.
//Statements to execute.
if( condition ) // only if the condition is true , then the control enters the loop, if the condition is not satisfied if skips the code.
//statements to execute ;
else // this is an else choice.. if the "if" block is not executed , then this loop is executed.
// statements to execute;
To understand switch please have a look at the attached document.