Example: Math Power

Create a method which calculates and returns as result the power of a given number.

Sample Input and Output

Input Output Input Output
2
8
256 3
4
81

Hints and Guidelines

Our first step is to read the input data from the console. The next step is to create a method, which will take two parameters (the number and the power) and returns as a result a number of type double.

After we have done the calculations, we have to only print the result in the Main() method of the program.

Testing in the Judge System

Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/594#5.

results matching ""

    No results matching ""