2_Questions_5_1_bool-1

2_Questions_5_1_bool-1 - CIS 15AG 1 Questions Chapter 5:...

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

View Full Document Right Arrow Icon
CIS 15AG Questions Chapter 5: Selection – Making Decisions (Logical and Relational Operators and Expressions) 1. Simplify: a. !(a == sqrt( b * b + c * c)) b. !(length >= width + 20) c. !(cDay < bDay) d. !(cMonth != bMonth) 2. Write a C logical expression that evaluates to true if the integer variable score is within the range [80, 90). What's wrong with the following expression? How would you correct it? 8 0 <= score < 90 3. Write a logical expression that checks if today is your birthday. int cMonth = 2; // current month int bMonth = 2; // birth month int cDay = 29; int bDay = 29; 4. Write a C logical expression that evaluates to true if the integer variable score is outside the range [80, 90). 5. Write a logical expression that checks if today is not your birthday. int cMonth = 2; // current month int bMonth = 2; // birth month int cDay = 29; int bDay = 29; 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
CIS 15AG Questions Chapter 5: Selection – Making Decisions (Logical and Relational Operators and Expressions) 6. Write a logical expression that evaluates to true if today is
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

2_Questions_5_1_bool-1 - CIS 15AG 1 Questions Chapter 5:...

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

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