What is the result of evaluating the following expression? (1/2 + 3.5) * 2.0
Advertisements
प्रश्न
What is the result of evaluating the following expression?
(1/2 + 3.5) * 2.0
संख्यात्मक
Advertisements
उत्तर
(1/2 + 3.5) × 2.0
= (0 + 3.5) × 2.0
= 3.5 × 2.0
= 7.0
In Java, 1/2 performs integer division, giving 0. Therefore, the final result is 7.0.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
