What is the output of the code snippet given below? string s = "aeiou"; int i = 0; do { system.out.print(s.substring(i, i + 1)); i++; if (i >= 3) { i = 5; } } while (i < 5);?
The loop progresses for i equal to 0, 1 and 2. But then i gets increased to 3, it gets set to 5, effectively terminating the loop. So only 3 characters get printed.