WHAT IS THE OUTPUT? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

WHAT IS THE OUTPUT?

public class Program { public static void main(String[] args) { int i,sum=0; for (i=0;1<2;i++){ System.out.println("sum"); } } }

6th Jan 2018, 3:53 PM
Akshaya
Akshaya  - avatar
8 Answers
+ 22
sum sum sum sum sum sum sum sum sum sum sum sum sum sum . . time limit exceed
6th Jan 2018, 6:40 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 12
infinity loop... That's a long output...🤣
31st May 2018, 1:36 AM
JTLZ
+ 11
what did you expect from this condition : 1<2 it always true!
6th Jan 2018, 3:57 PM
ZeroByte
ZeroByte - avatar
+ 8
It is infinite because 1 will always be smaller than 2.
6th Jan 2018, 3:55 PM
The Coding Sloth
The Coding Sloth - avatar
+ 5
1<2 is always true @infinity times sum is printed! :)
6th Jan 2018, 6:45 PM
Infinity
Infinity - avatar
+ 4
Thanks all my friends 😊😊😊
6th Jan 2018, 6:53 PM
Akshaya
Akshaya  - avatar
+ 3
My output is sum but it is infinite loop ....doesn't have end :(
6th Jan 2018, 3:54 PM
Akshaya
Akshaya  - avatar
0
in short it's a code that will crash eventually
6th Jan 2018, 9:39 PM
Rashed Latif
Rashed Latif - avatar