Write a program using scanner class to input two integers using parameters and find their sum and product
Answers
Answer:
import java.util.Scanner;
class AddNumbers.
{
public static void main(String args[])
{
int x, y, z;
System.out.println("Enter two integers to calculate their sum ");
Scanner in = new Scanner( );
Answer:
Hey there!
Program to input two integers using Scanner and find the product of their sum and difference.
import java.util.*;
public class Question3
{
static void main()
{
Scanner sc=new Scanner(System.in);
int a,b,s,d,p;
System.out.println("Enter two integers:");
a=sc.nextInt();
b=sc.nextInt();
s=a+b;
d=a-b;
p=s*d;
System.out.println("Sum="+s);
System.out.println("Difference="+d);
System.out.println("Product of Sum and Difference="+p);
}
}
Hope It Helps You!
mark me as the brainliest...