Statements in C Programming Language

Notes:

Statements in C programming language:
- Nicklaus Wirth one of the great computer scientist stated that; we can solve any real world problem by writing a program containing 4 types of programming language statements

1. Sequential statements
2. Conditional / Selection statements
3. Looping / Iterative statements
4. Jumping / Control transfer statements

1. Sequential statements: don’t break the normal flow of execution of a code
Normal flow of execution of a code is sequential i.e. statements are executed in the order in which they appear in the code. Variable declarations, assignment statements etc. are considered as sequential statements.
Ex:
int a=0;
a=10;
printf(“a= %d\n”,a); // a= 10

Note:
- Conditional, looping and jumping statements are considered as Control statements or control structures.

Control Statements in C:
- Control statements help us to get the control over flow of execution of a code. There are 3 types of control statements they are conditional, looping and jumping statements.

2. Conditional / selection:
- execute set of statements based the result of a condition
- if
- if else
- nested if else
- else if ladder
- switch case

3. Looping / Iterative:
- execute set of statements repeatedly
- for
- while
- do while

4. Jumping / control transfer:
- make the control to jump/ transfer directly from one place to another place
- break
- continue
- goto
- function call
- return