Hey guys! This is a relativity simple program. It compiles fine but when I try to execute there is a problem. Any insight or advise would be greatly appreciated. Thank you
import java.util.Scanner;
public class Power
{
public static void main( String[] args )
{
Scanner input = new Scanner( System.in );
System.out.print( "Enter two numbers separated by spaces: ");
double x = input.nextDouble(); //read first number
double y = input.nextDouble(); //read second number
double z = x * x;
for( int i = 1; i <= y; i++)
{
z *= x;
}
System.out.printf( "the answer is %d ", z );
}
}