Write a program to find the sum and product of any two numbers stored in two variables
Answers
Answered by
2
Answer:
Program:-
import java.util.*;
public class Operation
{
public static void main(String args[ ])
{
Scanner in=new Scanner(System.in);
int a,b,s=0,p=0;
System.out.println("Enter the numbers");
a=in.nextInt();
b=in.nextInt();
s=a+b;
p=a*b;
System.out.println("The sum of the numbers="+s);
System.out.println("The product of the numbers="+p);
}
}
Similar questions
Math,
2 months ago
English,
2 months ago
English,
2 months ago
CBSE BOARD XII,
4 months ago
Social Sciences,
10 months ago
Hindi,
10 months ago
Science,
10 months ago