Contents

Why do we need to alter the program flow?
a) decision alter   
b) decision making
c) decision pending             
d) decision seen

b

What is the value of variabls after the following loop termnates?
 int s=0, n=0;
do {n++; s+=n; if(s>=4) continue;} while(n<5);
a) 15      
b) 14                      
c) 16                      
d) 18

a

What is the value after execution of following code?
 int a=2, b=0; while(b<5) {a=a*2; b=b+1;}
a) 64      
b) 65                      
c) 66                      
d) 67

b

What is the value after execution of following code?
int a=25; for (int c=0; c<4; c++)
a=a-1; a=a+3;
a) 23      
b) 24                      
c) 25                      
d) 20

b

What is the output of following code?
do n*=2; while(n<48)
a) 24
b) 32                      
c) 48                      
d) 96

c

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

a