Control Statements: Introduction, Objectives and Statements, Compound Statement and Null Statement

Get top class preparation for UGC Environmental-Science right from your home: fully solved questions with step-by-step explanation- practice your way to success.

Download PDF of This Page (Size: 384K)

Image of control Statements

Image of Control Statements


  • The normal flow of execution in a high-level language is sequential, i.e., each statement is executed in the order of its appearance in the program.

  • Control statements enable us to specify the flow of program control, i.e., the order in which the instructions in a program must be executed.

  • They make it possible to make decisions, to perform tasks repeatedly or to jump from one section of code to another.

  • The statements which specify the order of execution of statements are called control flow statements.

  • There are many control flow statements provided in C++ that will be discussed in this lesson.


Image of Control Statements objectives

Image of Control Statements Objectives


Statements are the instructions given to the computer to perform any kind of action. Action may be in the form of data movement, decision making etc. Statements form the smallest executable unit within a C++ program. Statements are always terminated by semicolon.

Compound Statement

  • A compound statement is a grouping of statements in which each individual statement ends with a semi-colon.

  • The group of statements is called block. Compound statements are enclosed between the pair of braces ({}).

  • The opening brace ({) signifies the beginning and closing brace (}) signifies the end of the block.

Null Statement

  • Writing only a semicolon indicates a null statement.

  • Thus ‘;’ is a null or empty statement.

  • This is quite useful when the syntax of the language needs to specify a statement, but the logic of the program does not need any statement.

  • This statement is generally used in for and while looping statements.

Developed by: