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.

AnswerBot
4mo

Compute the value of X raised to the power of N for given integers X and N.

  • Read the number of test cases T

  • For each test case, read the values of X and N

  • Calculate X^N for each test case

  • Print the result...read more

Help your peers!
Select
Add answer anonymously...

Procol Software Developer Intern interview questions & answers

A Software Developer Intern was asked Q. Power of a Number Problem You are given two integers, X and N. Your task is to c...read more
A Software Developer Intern was asked Q. Minimum Operations to Equalize Array Given an integer array ARR of length N wher...read more
A Software Developer Intern was asked Q. Search in Infinite Sorted 0-1 Array Problem Statement You are provided with an i...read more

Popular interview questions of Software Developer Intern

A Software Developer Intern was asked Q1. Power of a Number Problem You are given two integers, X and N. Your task is to c...read more
A Software Developer Intern was asked Q2. Minimum Operations to Equalize Array Given an integer array ARR of length N wher...read more
A Software Developer Intern was asked Q3. Pair Sum Problem Statement You are given an integer array 'ARR' of size 'N' and ...read more
Procol Software Developer Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits