+ 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);
2 Answers
+ 1
99
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