Write a program to take two number as input and calculate their sum.
its from JAVA
Answers
Answered by
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
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