English, asked by MalayaDhal, 7 months ago

int a=5;
int b=16;
if(a>b)
a++;
--b;
System.out.println("a="+a);
System.out.println("b="+b);
Find output.....​

Answers

Answered by anindyaadhikari13
3

Question:-

  • Find the output of the following code snippet.

Working Out:-

Given code,

int a=5;

int b=16;

if(a>b)

a++;

--b;

System.out.println("a="+a);

System.out.println("b="+b);

Here,

a=5

b=16

So,

a>b is false. If block will not execute.

--b=15

So,

a=5

b=15

a and b gets printed.

Output:-

a=5

b=15

Similar questions