Challenge: Calculate the Power of a Number

Solve a slightly easy challenge in this lesson.

Problem statement

You are given a base and an exponent. Your task is to calculate the power of the number.

Input

We have already initialized the input variables base and exponent at the backend.

Output

We have declared the variable result for you. Your task is to store your output in the result.

Sample input

int base = 2;
int exponent = 3;

Sample output

result = 8

Get hands-on with 1200+ tech skills courses.