Give the output of the snippet:
int a=10,b=12; if(a>=10) a++; else ++b; System.out.println(a + "and" +b);
32 Likes
11and12
As a is 10, the condition if(a>=10) tests true, a++ is executed incrementing the value of a to 11. System.out.println(a + "and" +b); prints 11and12
a
if(a>=10)
a++
System.out.println(a + "and" +b);
Answered By
15 Likes
State the difference between = and ==.
int a = 3; while (a<=10) { a++; if(a== 5) continue; System.out.println(a); }
Predict the output:
int a=6,b=5,c; c = (a++ % b++) *a + ++a*b++;