What will the following functions return when executed? (1x2) a) int p= Math.abs(Math.max(-87,-77);
Answers
Answered by
1
Question :-
int p = Math.abs(Math.max(-87,-77));
Answer :-
There are two Math Operators used here -
1) Math.abs() - This Mathematical Method removes the sign of the number (+ve or -ve).
2) Math.max() - This Mathematical Method finds the largest of two numbers.
So,
Value of Math.max(-87,-77) :
-77
Value of Math.abs(-77) :
77
Now,
Now,Ultimately We Got The Value Of p
Now,Ultimately We Got The Value Of p•°• int p = 77
Similar questions