C Quiz on Conditions
1. If x=5 and y=3 will this condition execute? if(x > y)
a) yes
b) no
2. What do conditions do for programs?
a) faster processing
b) adds versatility
c) crashes them
3. What does an else statement do?
a) gives an alternative to the other conditions
b) always executes
c) nothing
4. What do the double equal signs mean? if (x==y)
a) x is equal to y
b) x does not equal y
c) check to see if x is equal to y
5. In an if statement when do you need the curly braces?
a) when there is one line in the condition
b) when there are two or more lines in the condition
c) never
6. What does this mean? if (x!=y)
a) if x doesn't equal y
b) if x does equal y
c) if x is greater than y
7. If x=5 and y=7 will this condition execute? if (x!=y)
a) yes
b) no
8. What does this mean? if (x>=y)
a) if x is greater than y
b) if x is equal to y
c) if x is greater than or equal to y
9. If x=8 and y=8 will this condition execute? if(x>=y)
a) yes
b) no