how to find powers in java
int n=Math.pow(N, P);
Java program to find the power of a number
@Test
public void powerOfTheNumberProgram13() {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter any NUMBER: ");
int number = scanner.nextInt();
System.out.println("Enter the POWER: ");
int power = scanner.nextInt();
scanner.close();
// Logic for finding the POWER of number
int powerOfNumber = (int) Math.pow(number, power);
System.out.println("Power of a " + number + "^" + power + ": " + powerOfNumber);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us