Write a program to print the power of 7 raised to 5.
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.
// Java program to find the power of a number
class GFG {
// Function to calculate N raised to the power P
static int power(int N, int P)
{
if (P == 0)
return 1;
else
return N * power(N, P – 1);
}
// Driver code
public static void main(String[] args)
{
int N = 7;
int P = 5;
System.out.println(power(N, P));
}
}
OUTPUT is in attachment.