Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Question2()
- {
- double math;
- String answer;
- answer = "yes";
- answer = "no";
- Scanner sqrt = new Scanner(System.in);
- Scanner ans = new Scanner(System.in);
- System.out.print("Enter a number: ");
- math = sqrt.nextDouble();
- Math.sqrt(math);
- Math.pow(math, 2);
- Math.pow(math, 1/3);
- Math.cbrt(math);
- Math.pow(math, 3);
- System.out.println("The square root of "+math+ " is "+Math.sqrt(math));
- System.out.println("The cube root of "+math+" is "+Math.cbrt(math));
- System.out.println("The square of "+math+" is "+Math.pow(math,2));
- System.out.println("the cube of "+math+" is "+Math.pow(math, 3));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement