CFORBEGINNERS.COM

C++ Answers on Booleans

1. In a AND operator what is necessary for execution?
    a) Only one condition can be true
    b) One condition must be true
    c) Both conditions must be true

2. Will this condition execute? x=5 y=7 if(x > 4) && (y < 6)
    a) yes
    b) no

3.Will this condition execute? x=10 y=7 if(x < 12) && ( y < 8)
    a) yes
    b) no

4. In a OR operator what is necessary for execution.
    a) Only one condition can be true
    b) Atleast one condition must be true
    c) Both conditions must be true


5. Will this condition execute? x=8 y=12 if(x > 7) || (y > 15)
   a) yes
    b) no

6. Will this condition execute? x=10 y=7 if(x > 7) || (y < 8)
    a) yes
    b) no

7. Will this condition execute? x=10 y=7 if !(x < 12 && y < 8)
    a) yes
    b) no

8. In a switch statement what must come after every case?
    a) curly braces
    b) scanf
    c) break

10. What is wrong with this? case (x > 2):
    a) cases can't have conditions
    b) cases must be capitalized
    c) cases must have ; not :