0

how to print the sum of 2 variables

hi

20th Sep 2016, 11:23 AM
rahul gautam
rahul gautam - avatar
7 Réponses
+ 3
System.out.println(a+b);
20th Sep 2016, 2:15 PM
varun singh
varun singh - avatar
+ 1
varun's answer is correct too vivek
20th Sep 2016, 3:55 PM
Andy
Andy - avatar
0
thanks vivek
20th Sep 2016, 2:35 PM
rahul gautam
rahul gautam - avatar
0
si tienes los valores ya dentro de las variables, puedes hacerlo dentro de un System.out.println como de manera rápida como System.out.println(a+b);
20th Sep 2016, 9:47 PM
Angel Cabrales
Angel Cabrales - avatar
0
int a,b; int c= a+b; System.out.println (c);
26th Sep 2016, 8:24 AM
Kashish Gupta
Kashish Gupta - avatar
0
vivek a and b are not strings....so they won't be concatenated..... but they will be added...!!
2nd Oct 2016, 8:55 PM
varun singh
varun singh - avatar
- 1
nope that will just print a and b separately do this int c= a+b; System.out.println(c);
20th Sep 2016, 2:21 PM
Vivek Anand