+ 1
What is the output of the code?
System.out.print((7/2)/2.0);
5 Answers
0
According to BODMAS
You need to solve the bracket first so 7/2 will return 3. Then the resultant is divided with 2.0 which is a double value and the result of this operation will also be a double value. So 3/2.0 = 1.5 and remember that 3.0/2 will also give the same result.
+ 1
Why don't u code it and see what happens?
+ 1
(7/2)=3
3/2.0=1.5
if it is(just in another case)
(7/2)=3
3/2=1
0
1.5
0
1.5



