elibraryportal Logo

Control Statement in C++

A statement is an instruction given to the computer to perform specific action. In a Statement can be either a single statement or a Compound statement.A Single statement specifies a single action and always terminated by a semicolon ;. A Compound statement also known as a blok, is a set of statements that are grouped as a compound statement and always ecclosed within curly braces {}.

Types of Control Statment.

There are three control statement that is.

  1. Conditional Statement
  2. Iteration or Loop Statement
  3. Jump Statement

Conditional Statement in C++

Conditional Statement also known as selection statements. Conditional Statement are used to make decisions based on a given condition.

Types of Conditional Statement

  1. if statement
  2. if-else statement
  3. nested if statement
  4. if-else-if ladder

Iteration or Loop Statement in C++

The statement that cause a set of statements to be executed repeatedly either for a specific number ot times or until some condition is satisfied are known as iteration statements.

Types of Loop Statement

  1. for loop
  2. while loop
  3. do-while-loop

Jump Statement in C++

Jump statement are used to alter the flow of control unconditionally .that is jump statements transfer the program control within a function unconditionally .

Jump Statement

  1. break statement
  2. continue statement
  3. Goto satement
Next TopicIdentifiers in C++