Computer Science, asked by TbiaSamishta, 1 year ago

What will be the result of arithmetic expression -7%2 ?(a) -3 (b) -1 (c) 1 (d) -3.5

Answers

Answered by adimaths
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 Secondman
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