Evaluate the value of n if value of p=5, q=19. [2] int n= (q-p) < (p-q)? (q-p) :( p-q);
Answers
Answered by
2
Answer:
n = -14
Explanation:
(q-p) < (p-q)
19-5 < 5-19
14 < -14
This evaluates false.
So, int n= p-q = -14
If the condition were to evaluate true int n would have been equal to (q-p)
This is a tertiary operator
Similar questions