0

What will be the output ?

int a=10,b=15; While(a<b) { System.out.println(b); a++; b++; } System.out.println(a);

16th Oct 2020, 4:09 AM
Mansi
Mansi - avatar
2 odpowiedzi
+ 4
It'll result in an infinite loop because the condition of your while loop will never become false. So it'll print the value of b incrementing each time.
16th Oct 2020, 7:06 AM
Minho
Minho - avatar
0
Haha output never ends if the last line is System.out.println(a) Else what ever you wrote it will throw a compiler erroe because ot doesn't recognise sysystem.out.println
16th Oct 2020, 4:17 AM
George