ICS Part 2 Computer Science Chapter 12 Online Test With Answers

ICS Part 2 Computer Science Chapter 12 Online Test

Sr. # Questions Answers Choice
1 Which of the following loop is available in C language? While Do-while For All
2 One execution of a loop is known as a(n): Cycle Duration Iteration Test
3 The keyword 'break' cannot be used within: Do-while If-else For While
4 If n=3, what will be the value of n after executing the following code?
do
n*=2
while (n<48);
24 32 48 96
5 What is the value of "a" after the execution of the following code?
int a 25;
for(int c=0; c<4;c++)
a=a-1;
a=1+3;
23 24 25 20
6 What is the value of "a" after execution the following code segment:
int a=2;
int b=0;
while(b<5)
{ a=a*2;
b=b+1;
}
a=a+1;
64 65 66 67
7 What is the final value of x after executing the following code:
For (int x=0; x<10; X++)
10 9 0 1
8 When does the code block following while (x<100) execute? When x is less then one hundred When x is greater then one hundred When x is equal to one hundred None
9 The body of for loop with single statement ends with: Right bracket ] Right brace } Comma , Semi colon ;
10 The body of while loop with multiple statements ends with: Right bracket ] Right brace } Comma , Semi colon ;
11 When is while loop more appropriate then for loop? The terminating condition occurs unexpectedly The body of loop will be executed at least once The program will be executed at least once The number times the loop will be executed is known before the loop executes
12 When is for loop more appropriate then while loop? The termination condition is known in advance The number of iterations is not known in advance The loop should be executed only once The loop should be executed at least once
13 Which of the following is a loop statement? If If-else Switch None
14 Semicolon is placed at the end of condition in: While loop Do-while loop For loop All
15 While loop is also called: Conditional loop Wend loop Counter loop Continuous loop
Download This Set

Is this page helpful?