Challenge: Calculate (a + b)^3
This challenge will test your knowledge of operator precedence.
We'll cover the following
Problem Statement
The task is to compute and display it on the console. The following mathematical formula is expanded as:
​​
Sample Input
a = 2
b = 2
Output
64
Coding Exercise
Write your code below. It is recommended​ that you try solving the exercise yourself before viewing the solution.
Note: There is a
test
function given in the code for testing purposes. Do not modify it.
Important Note: The power of is calculated as
datatype :: pow(x,y)
. Here, the data type is the return value of the power function.
Good luck!🤞
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy