if(condition) { //statements; } |
if(condition) { statements; //if condition is true } else { statements; //if condition is false } |
if(1st condition) { // statements; } else if(2nd condition) { // statements; } .. .. .. else { //statements; } |
switch(variable) { case label1: //statements; case label2: //statements; .. .. .. default: //statement to be executed if no case are matched; } |
switch(variable) { case label1: //statement; break; case label2: //statement; break; .. .. default: //statement to be executed if no case matched; } |