Thank you for registering.

One of our academic counsellors will contact you within 1 working day.

Please check your email for login details.
MY CART (5)

Use Coupon: CART20 and get 20% off on all online Study Material

ITEM
DETAILS
MRP
DISCOUNT
FINAL PRICE
Total Price: Rs.

There are no items in this cart.
Continue Shopping

what is code for adding two integers in java

what is code for adding two integers in java

Grade:12th Pass

3 Answers

qwertykey key
14 Points
8 years ago

hey its very simple

you need to use the + operator for adding nos in java

ex,

int a=9;

int b=1;

int s=a+b;

System.out.println(s);

the output will be 10

say thanks to qwertykey;for more help reply me on askiitians forum

bhaveen kumar
38 Points
8 years ago

a = 5;

b = 10;

c = a + b;

System.out.println("The sum is " + c);

Aravind Bommera
36 Points
8 years ago
import java.util.Scanner;
 
class AddNumbers
{
public static void main(String args[])
{
int x, y, z;
System.out.println("Enter two integers to calculate their sum ");
Scanner in = new Scanner(System.in);
x = in.nextInt();
y = in.nextInt();
z = x + y;
System.out.println("Sum of entered integers = "+z);
}
}

Think You Can Provide A Better Answer ?

Provide a better Answer & Earn Cool Goodies See our forum point policy

ASK QUESTION

Get your questions answered by the expert for free