Write a program to input base(b) and power(p). Use Math.pow( ) to
calculate the value of base, b raised to power (p) and print the output.
Pls use scanner class
Answers
Answered by
3
import java.util.*;
public class example
{
public static void main(String []args)
{
Scanner sc = new Scanner (System.in);
System.out.println("Enter base and power");
int b = sc.nextInt();
int p = sc.nextInt();
int x = Math.pow(b,p);
System.out.println(x);
}
}
Hope this code helps you!!!
Similar questions