accept two numbers from users subtract the smaller number from the larger number and display the result
Answers
Answered by
0
Answer:
import java.util.*;
public class Subtraction
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
int a,b,c,d,e;
System.out.println("Enter the numbers");
a=in.nextInt();
b=in.nextInt();
c=Math.max(a,b);
d=Math.min(a,b);
e=c-d;
System.out.println("The result is"+e);
}
}
Explanation:
Similar questions