Power Using Recursion
Easyjavapythonccppjavascript
Given integers X and N, compute X raised to the power N.
Input Format
A single line containing two integers X and N.
Output Format
Print X^N (with X^0 = 1).
Example 1
Input
3 4
Output
81
Explanation: 3^4 = 3 * 3 * 3 * 3 = 81.
- -10 <= X <= 10
- 0 <= N <= 15
Submit an attempt to unlock the solution. (Sign in first.)
Related Problems
- Factorial Using RecursionEasy · java, python, c, cpp, javascriptSolve Problem
- Fibonacci NumberEasy · java, python, c, cpp, javascriptSolve Problem
- Generate All SubsetsMedium · java, python, c, cpp, javascriptSolve Problem