Contents

Which of the following is the correct format for ternary operator?
a) condition, exp1 and exp2                            
b) exp1, condition, exp2
c) exp1, exp2, condition    
d) none of these

a

How many relational operators are used in mathematics?
a) four operators 
b) five operators
c) six operators  
d) seven operators

c

Explanation: greater than (>), less than (<), greater than or equal to (>=), less than or equal to (<=), equality (==), not equal (! =)


How many types of increment and decrement operator?
a) one    
b) two    
c) three  
d) four

d

Explanation: prefix increment, postfix increment, prefix decrement, postfix decrement


Which of the following are examples of prefix and postfix increment?
a) ++x                                   
b) x++
c) both a &b                        
d) x--

c

Which of the following are examples of prefix and postfix decrement?
a) --x     
b) x--     
c) both a & b
d) x++

c

How many types of compound assignment operators are used in mathematics?
a) three 
b) four   
c) five   
d) six

c

Explanation: addition assignment (+=), subtraction assignment (-=), multiplication assignment (*=), division assignment (/=), modulus assignment (%=)