Computer Science, asked by logso2375, 19 days ago

Write a Java program that takes two numbers as input from a user and displays the difference between the two numbers.

Answers

Answered by komal3236
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 abcaboutenglish
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