Learn about If-else Statement:-
If-else Selection Statement || If else in C Language The if selection statement performs an indicated action only when the condition is true otherwise the action is skip .The if…else selection allows you to specify that different actions are to be performed when the condition is true and when it’s false.
EXAMPLE:
If students grade is greater than or equal to 60
Print "passed"
else
print "Failed"
prints passed if the students is greater than or equal to 60 and Failed if the student’s grade is less than 60.in either case ,after printing occurs, the next pseudocode statement in sequence is “performed” .The body of the else is also indented.
Simple example
If ( grade >= 60){
Printf ("Passed");
}
else{
Printf ("Failed");
}//end else
No comments:
Post a Comment
Thanks for comment