Contents

How many times the following code print “OOP Using C++”?
int count=0;
while(count<10) {cout<<” OOP Using C++”; count++;}
a) 9                        
b) 10                      
c) 0                        
d) 11

b

How many times the following code print “OOP Using C++”?
int count=0;
while(count++<10) {cout<<” OOP Using C++”;}
a) 12      
b) 10                      
c) 9                        
d) 0

b

How many times the following code print “OOP Using C++”?
int count=0; do {cout<<” OOP Using C++”;}
while(count++<10)
a) 11
b) 12                      
c) 9                        
d) 13

a

What is the value of variables after the following loop terminates?
 int s=0, n=0;
do {n++; s+=n; if(s>4) break;} while(n<5);
a) 6                        
b) 5                        
c) -6                       
d) 0

a

How many times following loop display “Hello”?
 for (i=20; i>0; i--)
a) 20
b) 21                      
c) 22                      
d) 19

a

What is the value of p after executing code?
 int i, p=1;
for (i=1; i<6; i+=1) p*=2
a) 30      
b) 31                      
c) 32                      
d) 33

c