Chapter4_2-DecisionStatements

S gannouni dr a touir introduction to oop if else

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: lse Page 6 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP If-else Statement Syntax if (Boolean-expression) { statement1; } else { statement2; } next_statement; // the if clause // the then clause // the else clause • If Boolean-expression evaluates to true, statement1 (the then clause) is executed and the program continues at next_statement. • If Boolean-expression gives false, statement2 (the else clause) is executed and the program continues at next_statement. Page 7 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP If-else Statement Flow Chart if (Boolean-expression) { // the if clause Statement1; // the then clause } else { Statement2; // the else clause } Next_Statement; No Boolean-expres...
View Full Document

This document was uploaded on 03/03/2014.

Ask a homework question - tutors are online