Write a program to input to number then subtract the smaller number from the larger number
Answers
Answered by
4
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);
}
}
Answered by
3
Answer:
hey mate please refer to the attachment
Attachments:
Similar questions