Pow x n Problem

Pow x n Problem — ExecCode Easy DSA Practice

Solve the Pow x n problem on ExecCode. Free online easy DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the input needed to solve Pow x n. Your task is to implement pow(x, n), which calculates x raised to the power n (i.e., x^n). Return the required answer exactly as shown in the examples.

Examples

Input {"x": 2.1, "n": 3}; Output 9.261. Input {"x": 2.0, "n": -2}; Output 0.25. Input {"x": 0.5, "n": 0}; Output 1.0

Constraints

-100.0 0. -10^4 <= x^n <= 10^4

Practice Pow x n free on ExecCode. Browse DSA problems, topic map, and placement guides.