285 views
1 votes
1 votes

1 Answer

0 votes
0 votes
Static variable is initialized to 0. so i=0.

For first time initialization is executed. i=1, then condition check so i=2

print(i) //2

If condition is false.

For 2nd interation, increment then condition check so i=4.

print(i) //4

If condition is true so we get outside loop.

So output: 24

Related questions

1 votes
1 votes
1 answer
2
92komal asked Jan 28, 2018
235 views
what is the meaning of static single assignment how to solve