1@Test
2 public void powerOfTheNumberProgram13() {
3 Scanner scanner = new Scanner(System.in);
4 System.out.println("Enter any NUMBER: ");
5 int number = scanner.nextInt();
6 System.out.println("Enter the POWER: ");
7 int power = scanner.nextInt();
8 scanner.close();
9 // Logic for finding the POWER of number
10 int powerOfNumber = (int) Math.pow(number, power);
11 System.out.println("Power of a " + number + "^" + power + ": " + powerOfNumber);
12 }
1int base=2, power=5, result=1;
2while(power != 0) {
3 result = result * base;
4 power--;
5}
1int base=2, power=5, result=1;
2for(int i = 1; i <= power; i++) {
3 result = result * base;
4}