Statements in C language | Different types of Statements in C programming Language

Spread the love
   

         

          C programs are collection of Statements, statements is an executable part of the program it will do some action. In general all arithmetic actions and logical actions are falls under Statements Categories anyway there are few Statement categories

  • Expression Statements.
  • Compound Statements.
  • Selection Statements.
  • Iterative Statements.
  • Jump Statements.

Expression Statements:  

                  It is combination of variables,Constants,operators,Function Calls and followed by a semicolon. Expression can be any operation like Arithmetic operation or Logical Operation.
Few Examples for expression Statements 
X = Y + 10 ;
20 > 90;
a ? b : c ;
a = 10 + 20 * 30;
;   (This is NULL Statement ).

Compound Statement :

                Compound statement is combination of several expression statements. Compound Statement is Enclosed within the Braces { }.
Compound statement is also called as Block Statement.

There is no need of any semicolon at the end of Compound Statement. 

Example for Compound Statement

{
        int a=10,b=20,c;
        c = a + b;
        printf(“value of C is : %d n”,c);


You May like : Swapping The Nibbles of Character.

Selection Statements :

                Selection Statements are used in decisions making situations we will look about selections statements in Later Tutorials. Here is the few examples of Selection statements

  • if
  • if…else
  • switch

Iterative Statements :

              These are also Called as Loops. If we want to Execute a part of program many times we will use loops.We will going to explain each and Every loop in Detail in Later Tutorials. Here is the List of Basic loops in C language.

  • for loop.
  • while loop.
  • do-while loop.

Jump Statements : 

            These are Unconditional statements Jump statements are useful for Transfer the Control one part of program to other part of Program there are few Jump Statements in C

  • goto.
  • continue.
  • break.
  • return.

           All these Selection and Iterative and Jump Statements are Keywords and all are Lower Case Characters.


Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply