60.2k views
3 votes
Give the out put of the program snippet

Int a = 10, b = 12;
If(a>=10)
a++;
Else
++b;
System.out.println (" a = " + a + " and b= " + b);

1 Answer

4 votes

Answer:

Output will be as follows

a= 11

b= 12

Step-by-step explanation:

In this program, two values 10, and 12 assigned to two variables a and b respectively. In next step the values of a has been checked that whether it is equal to 10 or greater than 10. so according to the assigned values, a is equal to 10 so a is incremented by 1 and becomes 11. while there is no change in the value of b.

So the output of a = 11 and b= 12.

User Venomy
by
7.6k points