Chapter 7
True: b.
number >= 1 && number < 9
ch != 'q' && ch != 'k'
(number >= 1 && number <= 9) && number != 5
(number >= 1 && number <= 9) or else number < 1 || number > 9
Line 5: Should be scanf("%d %d", &weight, &height);. Don't forget those &s for scanf(). Also, this line should be preceded by a line prompting input.
Line 9: What is meant is (height < 72 && height > 64). However, the first part of the expression is unnecessary because height must be less than 72 for the else if to be reached in the first place. Therefore, a simple (height > 64) will serve.
Line 11: The condition is redundant; the second subexpression (weight not less than or equal to 300) means the same as the first. A simple (weight > 300) is all that is needed. But there is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access