Statements in C language | Different types of Statements in C programming Language
- Expression Statements.
- Compound Statements.
- Selection Statements.
- Iterative Statements.
- Jump Statements.
Expression Statements:
Compound 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.
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.