{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

st03-flow_control

# st03-flow_control - CSC 1111 Introduction to Computing...

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

1 CSC 1111 Introduction to Computing using C++ Flow Control (Self-test questions)

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

View Full Document
2 1. Evaluate Boolean Expressions (a > 2 && !(b != 0) || c < a) When a = 4, b = 3, c = 2 When a = 2, b = 0, c = 0 When a = 6, b = 0, c = 0 (a % 2 == 0 || b / 3 < 2 || a - b < c) When a = 3, b = 13, c = 2 When a = 2, b = 0, c = 0 When a = 7, b = 4, c = -99
3 2. Expressing Conditions (Exercise) Which of these correctly represent " a is not a negative number " a) ! (a < 0) b) a > 0 c) a >= 0 d) -a < 0

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

View Full Document
4 3. Expressing Conditions (Exercise) Which of these correctly represent " a, b, c are identical " a) a == b == c b) a == b && a == c c) a == b && b == c && c == a d) a == b || b == c || c == a
5 4. Expressing Conditions (Exercise) Which of these correctly represent " a, b, c are distinct " a) a != b != c b) a != b && a != c c) a != b && b != c && c != a d) !(a == b || b == c || c == a)

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

View Full Document
6 5. Expressing Conditions (Exercise) if ( a is not zero ) Which of these correctly represent the condition in the above if statement? a) !a == 0 b) a != 0 c) a d) !(a == 0)
7 6. Expressing Conditions (Exercise) How can we represent the following conditions? 1.

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.

{[ snackBarMessage ]}

### Page1 / 15

st03-flow_control - CSC 1111 Introduction to Computing...

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

View Full Document
Ask a homework question - tutors are online