12th Class Computer Science MCQS
The loop which never ends is called:
Nested loop
Infinite loop
Continuous loop
Running loop
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;
int a = 25;
for(int c=0; c<4;c++)
a=a-1;
a=1+3;
23
25
20
24
The body of while loop with multiple statements ends with:
Right bracket ]
Semi colon ;
Right brace }
Comma ,
When is for loop more appropriate then while loop?
The number of iterations is not known in advance
The termination condition is known in advance
The loop should be executed at least once
The loop should be executed only once
The loop structure that executes at least ones is
For
All
Do-while
While
Which of the following loop is called counter loop?
All
Do-while
While
For
This is a control structure that causes a statement or group of statement to repeat:
Duration
Test
Iteration
Decision statement
A counter can be defined as:
The initial value of a loop
The final value of a loop
The step value of a loop
A variable that counts loop iterations
Which loop structure always executes at least once?
Do-while
While
All
For
In which loop the condition comes after the body of the loop?
Do-while loop
B and C
While loop
For loop
Continue Reading Go to Next Page
Google Ads