b) What will be the output of the following code?
int a=5;
int b=16:
if(a>b)
a++;
--b:
System.out.println(“a=" +a);
System.out.println(“b=" +b);
Answers
Answered by
1
- Write the output of the following code.
Given that,
int a=5;
int b=16;
Now, a>b is false since 5 is less than 16.
So, if part will not execute.
Now, --b = 15;
and a=5 only.
Now, we will print the value of a
a=5
b=15.
a=5
b=15
Similar questions