st03-flow_control

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

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSC 1111 Introduction to Computing using C++ Flow Control (Self-test questions)
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 1. Evaluate Boolean Expressions 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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 3. Expressing Conditions (Exercise) Which of these correctly represent " a, b, c are identical " a) a == b == c b) c) d) a == b || b == c || c == a
Background image of page 4
5 4. Expressing Conditions (Exercise) Which of these correctly represent " a, b, c are distinct " a) a != b != c b) c) d) !(a == b || b == c || c == a)
Background image of page 5

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

View Full DocumentRight Arrow Icon
5. Expressing Conditions (Exercise) if ( a is not zero ) Which of these correctly represent the condition in the above if statement? a)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/28/2010 for the course CSC CSC1110 taught by Professor Cjyuan during the Fall '06 term at CUHK.

Page1 / 15

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online