Computer Science, asked by mohithj2002, 1 day ago

Convert 2√2*a²+b² Into equivalent C++ expressions

Answers

Answered by Anonymous
1

We're asked to convert the following expression into equivalent C++ expression:

$\longrightarrow 2\sqrt{2}*a^2+b^2$

C++ expression

\boxed{\texttt{2 * sqrt(2) * pow(a, 2) + pow(b, 2)}}

sqrt(2)

  • sqrt(2) - returns the square root of 2. Return data type: double.

pow(a,2)

  • pow(a, 2) - Returns 'a' is raised to the power. Return data type: double.

pow(b, 2)

  • pow(b, 2) - Returns 'b' is raised to the power. Return data type: double.

\rule{250}{2}

Additional information:

abs(num)

  • abs(num) - Computes the absolute value of a given number.

sqrt(num)

  • sqrt(num) - Used to find the square root of the given number.

pow(num, power)

  • pow(num, power) - Returns the given number to the power.

fmax(num1, num2)

  • fmax(num1, num2) - Used to find the maximum of two given numbers.

fmin(num1, num2)

  • fmin(num1, num2) - Used to find the minimum of two given numbers.
Similar questions