Control
Statements in C
When working there are several instances when we
need to make decisions .
Similarly, when
writing a program code one may come to point when a decision has to be made .
C allows decision to be made by evaluating a given
expression as true or false. Such an expression involves the use of logical and relational operators . Depending
on the outcome , program execution accordingly
branches out .
Types of control statements:
Control statements are divided in to 3 types,
1. Decision
Making or Conditional Statements.
2. Looping
Statements.
3. Jumping
Statements.
Decision Making or Conditional Statements:
According to the conditions statements will be
executed.
C supports the following decision making statements,
· if
or simple if statement.
· if
else statement.
· else
if ladder statement.
· Nested
if statement.
· switch
case statement.
Looping Statements:
Used to execute a group of statements repeatedly until the condition is satisfied.
C supports the following looping statements,
· while
loop (Entry control loop).
· do
while loop(Exit control loop).
· for
loop.
Jumping Statements:
In C programming, during execution of a loop it
becomes desirable to skip a part of loop or exit the loop as soon as certain
conditions occurs.
There are four Jumping statements in C and they are classified
in to two categories as follows:
· Conditional
Jumping statements.
· Unconditional
Jumping statements.
Conditional Jumping statements:
· break
statement.
· continue
statement.
Unconditional Jumping statements:
· return
statement.
· goto
statement.
Let’s discuss about each statements in our upcoming
posts.
Please show your support by subscribing my post
below.
Thank you …