Contents

Which expression correctly determines whether the value of beta lies between 0 and 100?
a) 0<beta<100          
b) 0<beta&&beta<100
c) (0<beta) &&(beta<100)
d) both b & c

d

What is the output of following code?
if((1==1) ||(2==2)||(3==3))
cout<<”Good”;
else cout<<”bad”;
a) Good                                
b) bad
c) Goodbad                          
d) no output

a

What is the output of following code?
x=1, y=2, z=3
if((x==y)|| (y==z) ||(z==2))
cout<<”YES”;
else cout<<”NO”;
a) NO    
b) YES  
c) yes  
d) no output

a

If y=10 and z=4?
switch(y-z) {
case 8: x=y+z; break;
case 9: x=y; break;
case 10: x=z; break;
default: x=y*2;}
a) 40      
b) 42                      
c) 35                      
d) 45

a

Which of the following is the correct syntax of if-else statement?
a) if(condition) statement 
b) else statement
c) if statement                     
d) both a & b

d

If you must make decision based on multiple choices, which of the following is best suited?
a) if                                        
b) else
c) if-else                                               
d) if-else-if

c