Contents

What is the result of C++ expression 9/5*2?
a) 3.6     
b) 0.9     
c) 0                        
d) 2

d

What is the result of C++ expression 5/9*2?
a) 0.27  
b) 1.11  
c) 0                        
d) 11

c

What is the result of C++ expression 13+21%4-2?
a) 0                        
b) 12                      
c) 16                      
d) 14

b

If ‘a’ is integer variable then statement a=5/2; will return……
a) 2                        
b) 2.5     
c) 5                        
d) 2.0

a

Given that x is an int variable and num is float variable containing the values 10.5, what will be the value of x after executing statement: x=num+2;?
a) 12.5  
b) 10.5  
c) 12                      
d) error

c

Given that x is a float variable and num is int variable containing the values 80.9, what will be the value of x after executing statement: num=x+2. 9;?
a) 83.8  
b) 84.0  
c) 83                      
d) 83.0

c