Sr. # | Questions | Answers Choice |
---|---|---|
1 | If x=10 and y=5,, what will the output of the following expression? x>y? x*y: x+y |
5 10 15 50 |
2 | Conditional operator is an alternative of: | if if-else Nested if All |
3 | Switch statement is an alternative of: | if if-else Nested if Nested if-else |
4 | Which of the following is used for making two way decision: | if-else If Nested if Switch |
5 | Which operator in C is called a ternary operator? | if ++ ? ( ) |
6 | Conditional operator takes _____________ operands. | 3 2 1 5 |
7 | Another term for a conditional operator is: | Ternary Binary Byte Iteration |
8 | Which of the following is equivalent to (p>=q)? | p<q !(p<q) p<q 1p<q |
9 | The case block ends with: | End select End case Break; Case else |
10 | How many times is the test expression of a switch statement evaluated? | 0 1 2 Once for each case |
11 | The first line in switch block contains: | The value of the first criterion The expression to be evaluated The statement to be executed if none of the criteria are true The statement to be executed if the criterion are true |
12 | A case can be defined as: | An individual condition to test A set of condition of test A statement that includes as if statement A block of selection |
13 | Which of the following are valid case statements in a switch? | Case 1: Case x<4: Case 'ab': Case 1.5: |
14 | Which is an example of multiple branches form single expression? | If statement Switch statement While loop All |
15 | What does a compound condition use to join two condition? | Relational operator Logical operator Relational Results Logical results |