Ask Question
29 September, 21:16

What will be the output of the following code snippet? boolean token1 = true; while (token1) { for (int i = 0; i < 10; i++) { System. out. println ("Hello"); } token1 = false; }

+5
Answers (1)
  1. 30 September, 00:23
    0
    The output of the code snippet will be ten "Hello" messages

    Explanation:

    while token = true

    i = 0 sends "Hello" to the screen

    i = 1 sends "Hello" to the screen

    i = 2 sends "Hello" to the screen

    i = 3 sends "Hello" to the screen

    i = 4 sends "Hello" to the screen

    i = 5 sends "Hello" to the screen

    i = 6 sends "Hello" to the screen

    i = 7 sends "Hello" to the screen

    i = 8 sends "Hello" to the screen

    i = 9 sends "Hello" to the screen
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What will be the output of the following code snippet? boolean token1 = true; while (token1) { for (int i = 0; i < 10; i++) { System. out. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers