Types Of Control Structures In C Language.

Types Of Control Structures In C Language.


Hello Programmers,

Today we will study what is control structure? and type of control structure in c language. In the last blog, we studied about casting and conversion.
Now we start our today topic which is control structure and type of control structure in c language.


Control Structure:


The control structure is that which defines the way or flows in which the execution of c language statements should take place to achieve the required result.

The control structure controls the flow of c program or defines the way in which the execution of the program should take place to achieve its purpose.


There is various control statement in c, for example, jumping, branching and looping and they can be categorized into three types. 


Type Of Control Structure:


1) Conditional Control Transfer Or Decision        Making Statements:


The decision-making statement or such type of statement select one set of statement out of two or more sets of statements depending on some given condition. These type of statements control the condition and transfer of statement. 

There are various decision-making statements:

I) simple If statement
II) If-Else statement
III)Nested If-Else statement
IV)Else-If ladder
V) Switch statement


2) Unconditional Control Transfer Or Jumping Statement:


These type of statement control unconditionally i.e. control is transferred without any condition.

The programmer always tries to avoid unconditional control transfer or jumping statement because it makes the program more complex and decreases the readability of the program.

There are various unconditional control transfer or jumping statements:

I) goto statements
II)break statements
III)continue statements



3) Repetitive Statements Or Looping Statements:


These type of statement execute the set of a statement for a countable number of times. The set of a statement which is executed to be repeated is termed as a body of a loop.

The repetitive statements save the programmer time and it makes work more efficient.

There are various loop statements used in c language:
I) for loop
II)while loop
III)do-while loop



Sharing Is Caring...

Comments :

Post a Comment