Chapter4_2-DecisionStatements

If boolean expression gives false statement is not

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: next_statement. • If Boolean-expression gives false, statement is not executed and the program continues at next_statement. Page 4 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP If-then Statement Flow Chart if (Boolean-expression) { Statement; } Next_Statement; Boolean-expression is true ? // the if clause // the then clause Yes execute Statement //the then clause No execute Next-Statement Page 5 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP If-else statement • The if-else statement provides a secondary path of execution when the if clause evaluates to false . • It extends the basic if-then statement by adding the else clause in order to do something when the if clause is fa...
View Full Document

Ask a homework question - tutors are online