If Else Selection Statement

Wednesday, April 29, 2009 · Posted in

If else selection statement is actually the same with if statement but the difference of if else selection statement from if is that there are two options that the program have to choose if the condition returns true or false. Example pseudo code:

Pseudo code:


1) If student’s grade is lower than 75

2) Print “You have to shift other course”
3) El
se
4) Print “You have to stay in IT”


Flowchart:

This is the flowchart, but id we were going to transform it to C program and then it would be like this;

Printf(“%s\n”, grade<75?”passed”:”failed”);



Powered by Blogger.