Depict the final values stored in variables x and y below? double a = - 8.35; double b = 16.74; double x = Math.abs(Math.ceil(a)); double y = Math.rint(Math.max(a,b));
Answers
Answered by
1
GO THROUGH THE ATTACHED IMAGE..
Attachments:
Answered by
0
Answer:
The final value stored in variable x is 6.0 and y is 15.0.
Explanation:
Given : Depict the final values stored in variables x and y below :
double a = - 8 . 3 5 ; double b = 1 6 . 7 4 ; double x = Math . abs ( Math . ceil ( a ) ) ; double y = Math . rint ( Math . max ( a , b ) ) ;
To find : values stored in variables x and y
double a = - 8 . 3 5 ; double b = 1 6 . 7 4 ; double x = Math . abs ( Math . ceil ( a ) ) ; double y = Math . rint ( Math . max ( a , b ) ) ;
Solution :
1. Math . ceil ( a ) gives - 6 . 0 and Math . abs ( - 6 . 0 ) is 6 . 0 .
2. Math . max ( a , b ) gives 1 4 . 7 4 and Math . rint ( 1 4 . 7 4 ) gives 1 5 . 0 .
The final value stored in variable x is 6 . 0 and y is 1 5 . 0 .
#SPJ3
Similar questions