Decision Making
Some times programmer needs to make decisions, he want the program to do one thing if the expression is right and another if it is wrong. So C provides us a platform to handle with such situations.
C has a variety of decision making statements, such as if,if-else,if-else ladder, etc..., we shall discuss them in this chapter's tutorials. We shall also see jump statements, jump statements are used when we want to stop the execution and to jump to another line on reaching a special condition. There are many jump and selection statements like break, continue, switch etc,,.
We have already seen a decision making operator in our previous tutorials, the ternary operator (recall), there we tested a condition and chose an expression to be evaluated. We shall see some more of them in the coming tutorials.
The block diagram or flow chart of this statements look like:
So if the entry condition is true one statement is executed or else another.
Sign up here with your email

ConversionConversion EmoticonEmoticon