Programs Using Control Statements
Control Statements Control Statements: These are used to modify the flow of execution and give better control over the program. Types of control Statements : Conditional Statements Looping Statements Branching Statements Break Statements. Return Statements. 1.Conditional Statements : Depending on the condition the corresponding statements will be executed . Types Of Conditional Statements: Simple if.. if ....else... else...if.... Nested If... Simple If: Even we have "n" conditions each and every condition will be mentioned in separate if Blocks. Each and every condition will be checked during the execution even though if any condition is satisfied all the conditions will be checked by compiler . In this conditions will returns a boolean values (true/false). If condition is true statements are executed else check for the other conditions . Syntax: if(Condition 1) { Statements; } if(Condition 2) { Statements; } ...