Chapter-12(Loop Constructs)
1
What
is the final value of x after executing the following code:
for
(int x=0; x <10; x++)
10
9
0
1
2
What
is the value of a after execution of the following code?
Int a = 25;
for (int c =0; c<4; c++)
a = a -1;
a = a +3;
23
24
25
20
3
The
body of while loop with multiple statements ends with:
Right bracket]
Right braces}
Comma,
Semi colon;
4
Which
is a loop statement?
if
if-else
switch
None
5
Semicolon
is placed at the end of condition in:
While loop
Do-while loop
For loop
All
6
While
loop is also called:
Conditional loop
Wend loop
Counter loop
None
7
This
means to increase a value by one:
Modulus
Increment
Decrement
None
8
This
statement may be used to stop a loop’s current iteration and begin next one;
Continue
Break
Terminate
None
9
A
for statement contains three expressions: initialization , test, __________ .
Null
Validation
Increment/decrement
None
10
A
special value that marks the end of a list of input data is called:
Terminal value
Sentinel value
Loop control value
Input value
11
One
execution of a loop is known as a (n).
Cycle
Duration
Iteration
Test
12
How
many types of loop are available in c language?
2
3
4
5
13
While
loop structure always executes at least once?
Do-while
For
While
None
14
Which
of the following loop is called counter control loop?
For
While
Do while
None
1
|
What
is the final value of x after executing the following code:
for
(int x=0; x <10; x++)
|
|||
10
|
9
|
0
|
1
|
|
2
|
What
is the value of a after execution of the following code?
Int a = 25;
for (int c =0; c<4; c++)
a = a -1;
a = a +3;
|
|||
23
|
24
|
25
|
20
|
|
3
|
The
body of while loop with multiple statements ends with:
|
|||
Right bracket]
|
Right braces}
|
Comma,
|
Semi colon;
|
|
4
|
Which
is a loop statement?
|
|||
if
|
if-else
|
switch
|
None
|
|
5
|
Semicolon
is placed at the end of condition in:
|
|||
While loop
|
Do-while loop
|
For loop
|
All
|
|
6
|
While
loop is also called:
|
|||
Conditional loop
|
Wend loop
|
Counter loop
|
None
|
|
7
|
This
means to increase a value by one:
|
|||
Modulus
|
Increment
|
Decrement
|
None
|
|
8
|
This
statement may be used to stop a loop’s current iteration and begin next one;
|
|||
Continue
|
Break
|
Terminate
|
None
|
|
9
|
A
for statement contains three expressions: initialization , test, __________ .
|
|||
Null
|
Validation
|
Increment/decrement
|
None
|
|
10
|
A
special value that marks the end of a list of input data is called:
|
|||
Terminal value
|
Sentinel value
|
Loop control value
|
Input value
|
|
11
|
One
execution of a loop is known as a (n).
|
|||
Cycle
|
Duration
|
Iteration
|
Test
|
|
12
|
How
many types of loop are available in c language?
|
|||
2
|
3
|
4
|
5
|
|
13
|
While
loop structure always executes at least once?
|
|||
Do-while
|
For
|
While
|
None
|
|
14
|
Which
of the following loop is called counter control loop?
|
|||
For
|
While
|
Do while
|
None
|