More Classes
5th Class
6th Class
7th Class
8th Class
9th Class
10th Class
11th Class
12th Class
NAT I
NAT II
CSS
IQ
General Knowledge
MDCAT
ECAT
GAT General
GAT Subject
Other Links
Go to Home
Online Tests
Computer Science Ics Part 2 Chapter 12 Online Test MCQs With Answers
Question # 1
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;
Choose an answer
23
24
25
20
Previous
Skip
Next
Question # 2
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;
Choose an answer
64
65
66
67
Previous
Skip
Next
Question # 3
Each record consists of a
Choose an answer
Rows
Columns
Both a and b
None of these
Previous
Skip
Next
Question # 4
The loop structure in which condition comes after the body of the loop is
Choose an answer
While
Do-while
For
All
Previous
Skip
Next
Question # 5
A special value that marks the end of a list of input data is called:
Choose an answer
Terminal value
Sentinel Value
Loop control value
Input value
Previous
Skip
Next
Question # 6
When is for loop more appropriate then while loop?
Choose an answer
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
Previous
Skip
Next
Question # 7
Repetition structure is used to execute a statement or set of statement
Choose an answer
Once
More than one time
Skip statement
All
Previous
Skip
Next
Question # 8
What is the final value of x after executing the following code:
For (int x=0; x<10; X++)
Choose an answer
10
9
0
1
Previous
Skip
Next
Question # 9
If n=3, what will be the value of n after executing the following code?
do
n*=2
while (n<48);
Choose an answer
24
32
48
96
Previous
Skip
Next
Question # 10
This statement may be used to stop a loop's current iteration and begin once:
Choose an answer
Continue
Break
Terminate
Next
Previous
Skip
Next
Question # 11
How many types of loop structure are available in C language?
Choose an answer
While
Do-while
For
All
Previous
Skip
Next
Question # 12
Which statement is used to move the control to the start of loop body?
Choose an answer
Continue
Break
Switch
Goto
Previous
Skip
Next
Question # 13
The loop which never ends is called:
Choose an answer
Infinite loop
Running loop
Continuous loop
Nested loop
Previous
Skip
Next
Question # 14
A counter can be defined as:
Choose an answer
The final value of a loop
A variable that counts loop iterations
The initial value of a loop
The step value of a loop
Previous
Skip
Next
Question # 15
________ contains icon button that are shortcuts to the commands in the menu
Choose an answer
Menu bar
Tool bars
Scroll bar
Status bar
Previous
Skip
Next
Question # 16
If we want a user to enter exactly 20 values, which loop would be the best to use?
Choose an answer
While
Do-while
For
Infinite
Previous
Skip
Next
Question # 17
A loop with in a loop is called:
Choose an answer
Nested loop
Complex loop
Infinite loop
Dual loop
Previous
Skip
Next
Question # 18
In which loop the condition comes before the body of the loop?
Choose an answer
While loop
Do-while loop
For loop
B and C
Previous
Skip
Next
Question # 19
One execution of a loop is known as a(n):
Choose an answer
Cycle
Duration
Iteration
Test
Previous
Skip
Next
Question # 20
When does the code block following while (x<100) execute?
Choose an answer
When x is less then one hundred
When x is greater then one hundred
When x is equal to one hundred
None
Previous
Skip
Next
Back