Answer:
Not mentioned in question, in which programming language the answer is required. Although, I am giving answer in Java language.
import java.util.*;
public class MaxNum {
public static void main (String args [] ) {
int x, y, diff = 0;
Scanner sc = new Scanner (System.in);
System.out.println (“Enter first value :”);
x = sc.nextInt();
System.out.println (“Enter second value :”);
y = sc.nextInt();
if ( x > y) {
diff = x – y;
System.out.println ( x + ” is maximum to y by ” + diff);
}
else if ( y > x) {
diff = y – x;
System.out.println ( y + ” is maximum to x by ” + diff);
}
else {
System.out.println (“Both the values are equal”);
}
}
}
Explanation: