/* The program will demonstrate how to find the square root and the power of a number. * */ import java.util.Scanner; public class SqrPow { public static void main(String[] args) { int x, y; double x1, y1; double sum = 0.0; Scanner key = new Scanner(System.in); System.out.print("Enter the first value: "); x = key.nextInt(); System.out.print("Enter the second value: "); y = key.nextInt(); //We call the sqrt() method x1 = Math.sqrt(x); y1 = Math.sqrt(y); // We call the pow() method sum = Math.pow(x, y); System.out.print("The square-root of " + x + " is " + x1 + "\n"); System.out.print("The squareroot of " + y + " is " + y1 + "\n"); System.out.print(x + " to the " + y +" power is " + sum); } }