KnowledgeBoat Logo

Computer Science

If m = 5, n =2; what will be the output of m and n after execution?

(a) m -= n

(b) n = m + m/n;

Java Operators

27 Likes

Answer

(a) m -= n

    m -= n
⇒ m = m - n
⇒ m = 5 - 2
⇒ m = 3

(b) n = m + m/n;

    n = m + m/n
⇒ n = 5 + 5 / 2
⇒ n = 5 + 2
⇒ n = 7

Answered By

10 Likes


Related Questions