ICS Part 2 Computer Science Online Test With Answers

image
image
image

ICS Part 2 Computer Science Online Test

Sr. # Questions Answers Choice
1 A counter can be defined as: The final value of a loop A variable that counts loop iterations The initial value of a loop The step value of a loop <br>
2 How many types of loop structure are available in C language? While Do-while For All
3 This is a control structure that causes a statement or group of statement to repeat: Decision statement Duration Iteration Test
4 If x=10 and y=5,, what will the output of the following expression?
x>y? x*y: x+y
5 10 15 50
5 Conditional operator is an alternative of: if if-else Nested if All
6 Switch statement is an alternative of: if if-else Nested if Nested if-else
7 Which of the following is used for making two way decision: if-else If Nested if Switch
8 Which operator in C is called a ternary operator? if ++ ? ( )
9 Conditional operator takes _____________ operands. 3 2 1 5
10 Another term for a conditional operator is: Ternary Binary Byte Iteration
11 Which of the following is equivalent to (p>=q)? p&lt;q !(p&lt;q) p&lt;q 1p&lt;q
12 The case block ends with: End select End case Break; Case else
13 How many times is the test expression of a switch statement evaluated? 0 1 2 Once for each case
14 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
15 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
16 Which of the following are valid case statements in a switch? Case 1: Case x&lt;4: Case 'ab': Case 1.5:
17 Which is an example of multiple branches form single expression? If statement Switch statement While loop All
Download This Set