2_Questions_5_1_bool-1

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

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

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

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online