MCQs
1
Operator ++ increases value of variable by 1. x = x + 1 can also be written in shorthand form as x += 1. Also x =+ 1 will set the value of x to 1.
Modulus operator can be applied to both integers and floating point numbers.
None
1.5 1
Modulus operator returns the remainder of a division operation on the operand. a = a % 10 returns 25.64 % 10 i:e 5.640000000000001. Similarly b = b % 10 returns 5.
Operator ++ has more preference than *, thus g becomes 4 and when multiplied by 8 gives 32.
x is initialized to 10 then increased by 1 by ++ operator making it 11. x is again decreased by ” operator making it 10, next x is incremented by post increment and intialized to y, here the value of x obtained before increment operator is executed, so value of y is 10 and value of x is 11.
x is initialized to 10 then increased by 1 by ++ operator making it 11. x is again decreased by ” operator making it 10, next x is incremented by post increment and intialized to y, here the value of x obtained before increment operator is executed, so value of y is 10 and value of x is 11.
All relational operators return a boolean value i:e true and false.