addition of two integer in java program.
Answers
Answered by
0
class Sum
{
void main(int a,int b)
{
System.out.println("Sum = "+(a+b));
}
}
{
void main(int a,int b)
{
System.out.println("Sum = "+(a+b));
}
}
Answered by
1
Program Language : {JAVA}
class Main {
public static void main(String[] args) {
int num1 = 9, num2 = 31;
int sum;
System.out.println("First Number: " + num1);
System.out.println("Second Number: " + num2);
sum = num1 + num2;
System.out.println("Sum: " + sum);
}
}
Output :
First Number: 9
Second Number: 31
Sum: 40
Similar questions
Physics,
7 months ago