Write the Java expressions for the following:
i. (a + b)² + b
ii. z = x³ + y³ +
Answers
Answered by
27
Java expression for the following:-
- (a+b)²+b
Answer:-
There are two ways to write it as a Java Expression:-
- Math.pow((a+b),2)+b
- ((a+b)*(a+b))+b
- z=(x*x*x)+(y*y*y)+((x*y)/3);
- z=Math.pow(x,3)+Math.pow(y,3)+((x*y)/3);
Note:-
- Math.pow() returns the number raised to power other number
- It always returns the double type value
More about Math Functions:-
- Math.max() is used to find the maximum value between 2 numbers. SYNTAX:- Math.max(a,b);
- Math.min() returns the minimum value between two numbers. SYNTAX:- Math.min(x,y);
- Math.abs() returns absolute value of the given number. SYNTAX:- Math.abs();
- Math.ceil() returns rounded value upto nearest higher integer. SYNTAX:- Math.ceil(x);
- Math.floor() returns rounded value upto nearest lower integer. SYNTAX;- Math.floor(x);
- Math.round() returns the rounded value of the number upto nearest integer.
- Math.cbrt() returns cube root of a number. SYNTAX:- Math.cbrt(x);
- Math.sqrt() returns square root of a number. SYNTAX:- Math.sqrt(x);
TheMoonlìghtPhoenix:
Wowsome!
Answered by
0
HERE IS UR ANSWER
refer attachment
Attachments:
Similar questions