Difference between two doubles

Report a typo

Write a program that reads two double values and prints the difference between the second and the first one.

Sample Input 1:

18.4
-5.0

Sample Output 1:

-23.4
Write a program in Java 17
import java.util.Scanner;

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// put your code here
}
}
___

Create a free account to access the full topic