Bootcamps
Masterclasses
Menu
Courses
Account
Login / Sign Up

Power of (a^b)

Easy Acceptance 85% Points 20

Description: You are given two integers a and b. Your task is to find the value of a raised to the power b (a^b) and print the result.

Examples
Example 1

Example 1

Input: a = 2, b = 3

Output: 8

Explanation: 2^3 = 8

Example 2

Example 2

Input: a = 5, b = 4

Output: 625

Explanation: 5^4 = 625

Constraints
  • Constraints: 1 < a < 50
  • 0 < b < 50
Topics
Recursion
Companies
Apple Samsung IBM
Added 19 Jul 2026 85% acceptance
Ln 1, Col 1Sign in to save your code
5 4
625