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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
