Which of the following are examples of prefix and postfix decrement?
a) --x
b) x--
c) both a &b
d) x++
The operator that is sued to check the relationship between two operands is called….
a) arithmetic operator
b) relational operator
c) compound assignment operator
d) increment and decrement operator
How many relational operators are used in mathematics?
a) four operators
b) five operators
c) six operators
d) seven operators
Explanation: greater than (>), less than (<), greater than or equal to (>=), less than or equal to (<=), equality (==), not equal (! =)
Which of the following operator are used to check whether an expression is true or false?
a) logical operator
b) relational operator
c) compound assignment operator
d) increment and decrement operator
How many types of logical operators?
a) two
b) three
c) four
d) five
Explanation: AND (&&) operator, OR (||) operator, NOT (!) operator
Which of the following operator takes three operands?
a) logical operator
b) relational operator
c) ternary operator
d) increment and decrement operator
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
Which of the following operators need a single operand for operation?
a) unary operator
b) binary operator
c) ternary operator
d) none of these
Which of the following operators need two operands for operation?
a) unary operator
b) binary operator
c) ternary operator
d) none of these
Which of the following operators need three operands for operation?
a) unary operator
b) binary operator
c) ternary operator
d) none of these
Expression
How many types of C++ expression?
a) eight
b) nine
c) ten
d) eleven
Explanation: constant expression, integral expression, float expression, pointer expression, relational expression, logical expression, bitwise expression, chained assignment expression, compound expression
What type of expression consist of only constant value?
a) constant expression
b) integral expression
c) float expression
d) pointer expression