Computer Science, asked by SwastikaSarkar, 8 months ago

Write a program to take two number as input and calculate their sum.
its from JAVA​

Answers

Answered by studyking7
4

Answer:

In this program, two integers 10 and 20 are stored in integer variables first and second respectively. Then, first and second are added using the + operator, and its result is stored in another variable sum . Finally, sum is printed on the screen using println() function.

Answered by Mathskadada123
2

Answer:

import java.util.Scanner;

public class sum

{

public void main()

{

int a,b,sum;

Scanner sc=new Scanner(System.in);

a=sc.nextInt();

b=sc.nextInt();

sum=a+b;

System.out.println("Sum of the two numbers is="+sum),

}

}

Similar questions