ConditionalsAndLoops

# ConditionalsAndLoops - COE318 Fall 2008 Olivia Das Elec and...

This preview shows pages 1–6. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

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

Unformatted text preview: COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 1 Conditionals and Loops: Review if, if/else, if/else if Loops: while, do-while, for COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 2 Boolean Expression • Boolean expression • evaluates to true or false • has equality , relational or logical operators • == , != equality operators • <, >, <=, >= relational operators COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 3 Boolean Expression • Logical Operators : take boolean operands • ! Logical NOT (unary) • && Logical AND (binary) • || Logical OR (binary) COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 4 Boolean Expression Logical NOT: if a is true , !a evaluates to false Logical AND: a && b evaluates to true if both a and b are true Logical OR: a || b evaluates to true if a or b is true Short Circuited operators - logical AND, logical OR COE318 Fall 2008, Olivia Das, Elec. and Comp. Engg., Ryerson University 5 Boolean Expression (examples) • say, I have int x = 3; int y = 5; int z = 3;...
View Full Document

{[ snackBarMessage ]}

### Page1 / 15

ConditionalsAndLoops - COE318 Fall 2008 Olivia Das Elec and...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online