What is the output of the following program: double w = 12.5; w*= 2; System.out.println("w is" + w);
Advertisements
Question
What is the output of the following program:
double w = 12.5;
w*= 2;
System.out.println("w is" + w);Very Short Answer
Advertisements
Solution
The statement w *= 2; multiplies the value of w by 2.
w = 12.5 × 2
w = 25.0
Output:
w is25.0
shaalaa.com
Is there an error in this question or solution?
