Computer Science, asked by ane57, 1 year ago

addition of two integer in java program.

Answers

Answered by siddhantdixit007
0
class Sum
{
void main(int a,int b)
{
System.out.println("Sum = "+(a+b));
}
}
Answered by Anonymous
1

\underline{\sf\blue{ᴀɴꜱաɛʀ}}

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