Computer Science, asked by errireddy123, 6 months ago

write down java expression for
x= |A|+|B|+|AB|​

Answers

Answered by BrainlyProgrammer
2

Question:-

JAVA expression for

  • x=|A|+|B|+|AB|

____________________

Answer:-

x=Math.abs(A)+Math.abs(B)+Math.abs(A*B);

__________________

Note:-

  • Math.abs() always returns a value depending upon the data type of the value.
  • Math.abs() always returns an absolute valve of the given number (returns the positive value).

__________________

More about math functions:-

  1. Math.max() is used to find the maximum value between 2 numbers. SYNTAX:- Math.max(a,b);
  2. Math.min() returns the minimum value between two numbers. SYNTAX:- Math.min(x,y);
  3. Math.pow() is returns a number raised to power x ({n}^{x}) SYNTAX:- Math.pow(n,x);
  4. Math.ceil() returns rounded value upto nearest higher integer. SYNTAX:- Math.ceil(x);
  5. Math.floor() returns rounded value upto nearest lower integer. SYNTAX;- Math.floor(x);
  6. Math.round() returns the rounded value of the number upto nearest integer.
  7. Math.cbrt() returns cube root of a number. SYNTAX:- Math.cbrt(x);
  8. Math.sqrt() returns square root of a number. SYNTAX:- Math.sqrt(x);

Similar questions