SIMPLE, COMPOUND, CONTROL STATEMENTS - C-Tutorial

Latest

Saturday, 8 October 2016

SIMPLE, COMPOUND, CONTROL STATEMENTS

STATEMENTS
  
       
A statement is a syntactic construction that performs some action when the program is executed.  In C language, statements are classified into three types as:

            1. Simple (or) Expression Statements
            2. Compound (or) Block Statements
            3. Control Statements

1. Simple (or) Expression Statements
           
            A simple statement is a single statement that ended with a semicolon.

            Example:        int a,b,c;

2. Compound (or) Block Statements

            The collection of simple statements placed in between pair of braces is called compound statements.  Compound statements are also known as block statements.

Example:        {
                                                int a,b,c;
                                                float x,y;
                                                double z;
                        }

3. Control Statements

            Generally, In C-language the statements normally executed in sequential order from top to bottom.  But sometimes it is necessary to skip one or more statements, execute the same statements repeatedly based on certain conditions and control is necessary to change from location to another location.   
           
            In C language, control statements are classified into three categories as:

a)      Selection (or) Decision Control Statements
b)      Loop (or) Iterative Control Statements
c)      Branch (or) Jump Control Statements


No comments:

Post a Comment