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

    1. Now Playing
      Up NextBasic Syntax Of A C Program_ C Tutorial In Hindi #5
    2. Now Playing
      Up NextC Programming Tutorial for Beginners: Learn C Programming Language
    3. Now Playing
      Up NextStructures in C
    4. Now Playing
      Up NextC Operators based questions
    5. Now Playing
      Up NextC Language Cheatsheet 🧾 for Beginners 🔥
    6. Now Playing
      Up NextC Programming For Beginners – A 20 Day Curriculum!
    7. Now Playing
      Up NextProgram of Structures using C Programming
    8. Now Playing
      Up NextTypedef In C_ C Tutorial In Hindi #38
    9. Now Playing
      Up NextC vs C++
    10. Now Playing
      Up NextC language
    11. Now Playing
      Up NextC Operators Learn the Basics of Programming Step by Step – MPS
    12. Now Playing
      Up NextPrefix and Postfix increment operator in C Programming [ C Program ]
    13. Now Playing
      Up NextThe Difference Between C Languages in 90 seconds - 720
    14. Now Playing
      Up NextC Pointers questions -1
    15. Now Playing
      Up NextUnderstanding the Difference Between C and C++ Programming Languages
    16. Now Playing
      Up NextWrite a Program to Display your name in C [ 3 Different Methods ]
    17. Now Playing
      Up NextC Program to Print Multiplication Table of a Given Number: Using C++
    18. Now Playing
      Up NextHow to Compile and Run C Program in Linux
x
   

         

          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

Ezoic

{
        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

  • ifEzoic
  • 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.

Ezoic
  • 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

Hi Guys, I am Venkatesh. I am a programmer and an Open Source enthusiast. I write about programming and technology on this blog.

You may also like...

3 Responses

  1. Daniel Frappier says:

    If a C program is a list of statements, where do fit declarations like int a = 0; ? Which are declaration, not statements ? I do not really find an explanation anywhere. Thanks.

    • Hey Daniel,

      int a = 10; also a statement. All the declarations and assignments and operations all are called statements.

      So even the declarations also come under the statements.

  1. […] int n; is not a comment and It is a valid C statement, Which will be executed by the […]

Leave a Reply

x
Current Time 0:00
Duration 0:00
Remaining Time 0:00
1x
    • captions off, selected