write a program in q basic to display difference of 2 numbers given by users
Answers
Answered by
0
Answer:
import java.util.*;
public class Number
{
⠀⠀public static void main (String args [])
⠀⠀{
⠀⠀Scanner in = new Scanner (System.in);
⠀⠀int a,b,s,p,d;
⠀⠀System.out.println("Enter the two numbers :");
⠀⠀a = in.nextInt();
⠀⠀b = in.nextInt();
⠀⠀s = (a+b);
⠀⠀p = (a*b);
⠀⠀d = ((a*b) - (a+b));
⠀⠀System.out.println("Sum of the two numbers =" +s);
⠀⠀System.out.println("Product of the two numbers =" +p);
⠀⠀System.out.println("Difference between the product and the sum of the two numbers =" +d);
⠀⠀}
Explanation:
Similar questions