Power of a Number Problem

You are given two integers, X and N. Your task is to compute the value of X raised to the power of N (i.e., X^N).

Input:

The first line contains an integer T, the number of test cases.
Each of the next T lines contains two space-separated integers X and N.

Output:

For each test case, output a single integer which is the result of X^N.
Each result should be printed on a new line.

Example:

Input:
3
2 3
5 0
10 2
Output:
8
1
100

Constraints:

  • 1 <= T <= 5
  • 0 <= X <= 10
  • 0 <= N <= 10

Note:

Assume that 0^0 is 1.

Be the first one to answer
Add answer anonymously...
Procol Software Developer Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter