Write a Java program that takes two numbers as input from a user and displays the difference between the two numbers.
Answers
Answered by
0
Java Basic: Exercise -5 with Solution
Write a Java program that takes two numbers as input and display the product of two numbers.
Test Data:
Input first number: 25
Input second number: 5
Pictorial Presentation:
Java: Display the product of two numbers
Explanation:
Hope it helps you
Answered by
0
Answer:
import java.util.*;
class Checker
{
public static void main(String args[])
{
int input1,input2,diff;
Scanner sc=new Scanner(System.in);
System.out.println("Enter The Input 1:");
input1=sc.nextInt();
System.out.println("Enter The Input 2:");
input2=sc.nextInt();
diff=input1-input2;
System.out.println("The Difference is : " + diff);
}
}
Similar questions
Chemistry,
9 days ago
History,
9 days ago
Math,
9 days ago
Economy,
19 days ago
Physics,
19 days ago
English,
9 months ago
World Languages,
9 months ago
Social Sciences,
9 months ago