What will be the result of arithmetic expression -7%2 ?(a) -3 (b) -1 (c) 1 (d) -3.5
Answers
Answered by
1
If the containing variable is a integer then answer would ber -3 and if it's float then answeR would be -3.5
Answered by
6
"Option: (b), -1
The question provides no context in which it is asked. The expression may give different outputs in different compilers/programming languages. I am answering the question in reference to java programming language. The result of the arithmetic expression -7%2 will be equal to -1. In java, the use of modulo operator with a negative number yields the result with the dividend’s sign itself.
"
Similar questions
Computer Science,
7 months ago
Math,
1 year ago
Math,
1 year ago
Math,
1 year ago
Physics,
1 year ago