C program is a set of instructions written one after another .
The control structure,will decide the flow of execution.
There are three types:
1] sequential control structure.
2] decision control structure.
3] looping control structure.
1] sequential control structure:
When the set of instructions are executed one after another sequentially, the structure is known as sequential control structure.
Consider the following example.
void main( )
{
statement 1 ;
. .
. .
}
2] Decision control structure:
May a times, we want a set of instructions to be executed in one situation and an entirly different set of instruction to be executed in another situation.
At this time the particular structure used is called decision/branching control structure.
The decision control structure can be implemented by using
• if statement
• if...else statement
• else...if ladder
• goto statement
• conditional operators
• switch...case statement
In looping control structure certain group of statement are executed either a specific no of time or for a specific condition.
Looping control structure can be implemented by the following statements.
• while loop
• do...while loop
• for loop
nice bro
ReplyDelete