Decision making and branching

We have seen that a C program is a set of statements which are normally executed sequentially in the order in which they appear. This happens when no options are available. During programming, we have a number of situations where we may have to change the execution of statements on certain conditions, or repeat a group of statements until certain  specified conditions are met. This involves a kind of decision making to see whether a particular condition has occured or not and then  direct the computer to execute certain statements accordingly.
 C language supports the following statements to possesses such decision making capabilities.

 i)   if statement
 ii)  switch statement
 iii) Conditional operator statement
 iv)  goto statement

These statements helps in decision making, so these are called as decision making statements. Also these statements controls the flow of execution ,so they are also known as control statements.


 

Comments

Popular posts from this blog

Components of C language

Decision making using if statement

How to make payment for final certificate, migration, provisional for the students of last semester of ptu?