+ 1

what will be the output of the following code?

int a=0,b=30,c=40; a=--b +c+ ++b; system.out.println("a="+a);

21st May 2019, 12:30 PM
Aman Kumar
Aman Kumar - avatar
2 odpowiedzi
+ 1
99
21st May 2019, 12:59 PM
Shashwat Sahay
Shashwat Sahay - avatar
0
Like I answered in another post of yours try using pseudocode in your native language Line 1 declare and initialize 3 variables of datatype int(whole numbers) and store values 0, 30 and 40 respectively. Think of variable a as the "result" Line 2 pre-decrement b by one (29), add 40, then add 30 - Result is 99 Do a System.out.println on all. Three variables a = 99 b = 30 c = 40
21st May 2019, 1:00 PM
HNNX 🐿
HNNX 🐿 - avatar