Computer Science, asked by jerinshoba81, 1 month ago

Write a program to find the sum and product of any two numbers stored in two variables ​

Answers

Answered by kamalrajatjoshi94
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, 21 days ago