Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.text.DecimalFormat;
- import java.util.Scanner;
- public class mathPower {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- double num1 = Integer.parseInt(console.nextLine());
- int num2 = Integer.parseInt(console.nextLine());
- DecimalFormat df = new DecimalFormat("#.#######################");
- System.out.println(df.format(powerNumber(num1, num2)));
- }
- private static double powerNumber(double num1, int num2) {
- return Math.pow(num1, num2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement