Home / Programming MCQs / JAVA MCQs / Question

R

Ram Sharma • 188.81K Points
Coach

Q. What is the value of tip after executing the following code snippet?

Code:
int meal = 5;
int tip = 2;
int total = meal + (meal>6 ? ++tip : --tip);
(A) 1
(B) 2
(C) 3
(D) 6

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.