Computer Science, asked by ssanika361, 2 months ago

Write the java expression .a^2/b^2​

Answers

Answered by BrainlyProgrammer
7

Java Expression for:

 \dfrac{ {a}^{2}}{ {b}^{2} }

Answer:-

 \sf Answer \rightarrow{ \boxed{\tt \: {Math.pow(a,2)/Math.pow(b,2)}}}

Remember:-

Math.pow() always returns in double

Answered by SƬᏗᏒᏇᏗƦƦᎥᎧƦ
17

Question:

  • Write the java expression of a²/b²

Need to do?

  • We have to create and write a Java expression of the given expression.

Understand the terms first:

  • Math.pow : This returns the value of the first argument raised to the power of second argument. First number is called base number and second is argument is called exponent.

The syntax and return type would be:

  • Syntax - Math.pow(x,y)
  • Return type - double

Answer formed:

  • :   \implies \: \bf{ \dfrac{Math.pow(a,2)}{Math.pow(b,2)} }

Here base number is a and b and the exponent is 2 in both.

Additional information:

• Method is a named block of a códe in a class. It is executed within a defined set of instructions.

• Methods and variables of math class are defined as static members.

• Java.lang package contains classes and interfaces which are fundamental to Java programming language.

• The math class of java.lang package contains generic mathematical functions including some geometric and trigonometric function.

Syntax : Math.MethodName(arguments)

• Math.cbrt returns cube root of a double value.

• Math.ceil returns smallest integer which is greater or equal to the argument.

• Math.max gives largest of two arguments

• Math.min gives smallest of two arguments.


anindyaadhikari13: We can also write Math.pow(a/b,2)
Similar questions