If the value of basic =1500, what will be the value of tax after the following statement is executed?
tax=basic >1200? 200:100
Ans is 200
I need to know how did they get the answer (200) ? (working of the sum)
Answers
Answered by
4
Answer:
Value of tax will be 200. As basic is 1500, the condition of ternary operator — basic > 1200 is true. 200 is returned as the result of ternary operator and it gets assigned to tax.
Similar questions
English,
5 months ago
English,
5 months ago
Chemistry,
11 months ago
Computer Science,
11 months ago
Social Sciences,
1 year ago
History,
1 year ago