Sum | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Sum

x y int

10th Dec 2016, 8:46 PM
Erica Medina
Erica Medina - avatar
10 Answers
+ 33
Inside main: int x = 1; int y = 1; int sum = x + y; System.out.println(sum); or System.out.println(x+y);
10th Dec 2016, 9:00 PM
R2-D2
R2-D2 - avatar
+ 5
int z=x+y;😂😂
10th Dec 2016, 8:50 PM
manish rawat
manish rawat - avatar
+ 3
both statement are valid...... in sop you have to add variables until any string doesn't appear. once string appear in sop then variables value are concatenated e.g int x,y=10; sop(x+y+" hello "+x+y); result will be like 20 hello 10 10
11th Dec 2016, 5:38 AM
Kirit Guna
+ 1
It seems that is your very first code? :)
10th Dec 2016, 9:12 PM
gone
+ 1
int sum?
11th Dec 2016, 6:14 AM
nrbr
nrbr - avatar
+ 1
int x=1, y=1, sum; sum = x + y; System.out.println(sum);
12th Dec 2016, 2:17 PM
Ben Fo
Ben Fo - avatar
+ 1
int x1=20; int x2=x1+25; system.out.println(x2);
19th Dec 2016, 12:44 PM
Ll Spkt
Ll Spkt - avatar
0
2
11th Dec 2016, 7:40 AM
parvulescu boby
parvulescu boby - avatar
0
😀
11th Dec 2016, 9:44 AM
Nurbek Makhmudov
Nurbek Makhmudov - avatar
0
i think so you are good this is how it work
13th Dec 2016, 7:49 PM
Malik Ifrahim
Malik Ifrahim - avatar