Semester : S1 and S2
Subject : Computer Programming
Year : 2017
Term : DECEMBER
Branch : BIOTECHNOLOGY
Scheme : 2015 Full Time
Course Code : CS 100
Page:3
The statements that are used to control the flow of execution of statements are known as conditional control
statements.
Conditional statements are divided into three types:-
1. Conditional
2. Unconditional
3. Looping
Conditional Control statements:
A ‘c’program is 3 set of statements which are normally executed sequentially in the order in which they appear. This
happens when no options (or) no repetitions of certain calculations are necessary .however in practice we have a
number of situations where we may have to change the order of execution of statements until certain specified
conditions are met. This involves a kind of “decision making” to see whether a particular condition has occurred (00
not & then direct the computer to execute certain statements accordingly.
‘C’ language passes such decision making capabilities & supports the following statements known as conditional (or)
decision making statements.
1. if statements
3. conditional operator statement
If statement
The ‘if' statement is a powerful decision making statement and is used to control the flow of execution of statements.
It is basically a two way decision statement and is used in conjunction with as expression .It takes the following form:-
if (test expression )
It allows the computer to evaluate the expression first & then depending on whether the value of the expression
(relation(or)condition) 15 'true'(non-zero)or 'false'(zero), it transfer the control to a particular statement .This point of
program has two paths follow. one for true condition & the other for the false condition.
ext expression
True block statement
false block statement
Stmt-x
2. switch statement