control structure

In a program, all the instructions executed sequentially by default. when no repetition of calculations is necessary. this type of execution is called sequential execution. In some situations, there may be cancer to change the execution order of statements based on a certain condition or to repeat a set of statements until certain conditions are met. normally there are two types of control structures are here in the C program.
  • conditional control structure
  • unconditional control structure


 

these are the types of the conditional structure.
conditional structure:-
conditional structuire its mainly used for checking condition .
supose our condition is true its will print our given statement.
there are two type of the condiitional structers are there in this c program.
        • selction
        • looping    
these are the two types of conditional structure.

selection:

it allow programmers to make choce from alternative paths.
these also contains 4 typese.

        • if
        • if else
        • nested if
        • switch
looping:
looping sattement normally called iteration looping statement.
it allows the the programmers to repeat set of instruction in specified number of times.
looping mainly consits of two parts,one is body of the loop and another one is control statement.
the control statement is used to rest the condition nd then redirects the repeated
execution of the statements in the body of the loop.
        • for
        • while
        • do while

unconditional control:

unconditional statements areused to transfer control to other statements without checking the
condition.
there are the 3 types .
        • break
        • continue
        • goto

No comments:

Post a Comment