Compute: z = sqrt(y - x)
Start
Compute z = y - x
Ex: If the input is 3.0 and 4.0, then the output is 1.0.
import java.util.Scanner;
public class MathFunctions {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
double x, y, z;
x = scnr.nextDouble();
y = scnr.nextDouble();
// Your code goes here
System.out.printf("%.1f", z); // This will output z with one decimal place.
}
}