Computer Science, asked by rajeshwarivaangadi, 6 months ago

9) Write the out put for the following segment. (Assume a as 0 in the program given.)
if(a>0 && a<20)
a++;
else a--;
System.out.println(a);​

Answers

Answered by anindyaadhikari13
1

Question:-

  • Write the output of the following code snippet.

Solution:-

Given,

a=0

So,

a>0&&a<20 is false

So,

else part will execute,

Therefore,

a--

=-1

Output:-

-1

Similar questions