P a p e r C o d e | 8501
The Punjab College of commerce and computer sciences
Haroonabad ®
Name: --------------------------------- Roll No: -----------------------
Time Allowed: 20Min Total Marks: 17
PAPER COMPUTER SCIENCE (OBJECTIVE) CLASS ICS-II
Q. #1:- MCQS. Encircle correct one. (10*1=17)
1. Which loop structure always executes at least once?
A Do-while B for C while D None
2. This statement causes a loop to terminate early?
A break B terminate C exit D Both a and b
3. Which statement is used to move the control to the start of loop body?
A continue B break C switch D None
4. This means to increase a value by one:
A modulus B Increase C decrease D None
5. Which loop is also called:
A Conditional loop B Wend loop C Counter loop D None
6. What is the output of the following code?
int n=4;
do
{
n=n*3;
}
while(n<=100);
A 108 B 110 C 107 D 100
7. What is the output of the following code?
int n=4;
for(int i=n;i>=0;i--)
n-=i;
A -6 B 5 C -7 D -5
8. What is the output of the following code?
int n=0;
for(int m=0;m<10;m++)
{
n+=m++;
}
cout<<n<<endl;
A 20 B 21 C 22 D 18
9. How many times the following code prints “OOP Using C++”?
Int count=0;
do
{
cout<< “OOP Using C++”;
} while (count++<10);
A 11 B 12 C 9 D 13
10. What is the value of variables after the following loop terminates?
int s=0;
int n=0;
do
{
n++;
s +=n;
if(s>=4) countinue;
}
while (n<5);
A 15 B 14 C 16 D 18
(Best of Luck)
P a p e r C o d e | 8502
The Punjab College of commerce and computer sciences
Haroonabad ®
Name: --------------------------------- Roll No: -----------------------
Time Allowed: 20Min Total Marks: 17
PAPER COMPUTER SCIENCE (OBJECTIVE) CLASS ICS-II
Q. #1:- MCQS. Encircle correct one. (10*1=17)
1. Which loop structure always executes at least once?
A Do-while B for C while D None
2. This statement causes a loop to terminate early?
A break B terminate C exit D Both a and b
3. Which statement is used to move the control to the start of loop body?
A continue B break C switch D None
4. This means to increase a value by one:
A modulus B Increase C decrease D None
5. Which loop is also called:
A Conditional loop B Wend loop C Counter loop D None
6. What is the output of the following code?
int n=4;
do
{
n=n*3;
}
while(n<=100);
A 108 B 110 C 107 D 100
7. What is the output of the following code?
int n=4;
for(int i=n;i>=0;i--)
n-=i;
A -6 B 5 C -7 D -5
8. What is the output of the following code?
int n=0;
for(int m=0;m<10;m++)
{
n+=m++;
}
cout<<n<<endl;
A 20 B 21 C 22 D 18
9. How many times the following code prints “OOP Using C++”?
Int count=0;
do
{
cout<< “OOP Using C++”;
} while (count++<10);
A 11 B 12 C 9 D 13
10. What is the value of variables after the following loop terminates?
int s=0;
int n=0;
do
{
n++;
s +=n;
if(s>=4) countinue;
}
while (n<5);
A 15 B 14 C 16 D 18
(Best of Luck)