Answer:
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter the first: ");
int first = input.nextInt();
System.out.print("Enter the second: ");
int second = input.nextInt();
input.nextLine();
System.out.print("Enter your name: ");
String name = input.nextLine();
int difference = Math.abs(second - first);
System.out.println(name + ", the difference is " + difference);
}
}
Explanation:
*The code is in Java.
Create a Scanner object to get input from the user
Ask the user to enter the first, second, and name
Calculate the difference, subtract the second from the first and then get the absolute value of the result by using Math.abs() method
Print the name and the difference as in required format