Ask Question
2 August, 08:58

What will be the output of the following code snippet? token = False while token : print ("Hello")

A) "Hello" will continue to be displayed until the user stops the program.

B) No output because of compilation error.

C) No output after successful compilation.

D) "Hello" will be displayed only once.

+5
Answers (1)
  1. 2 August, 11:46
    0
    Hi!

    The correct answer is B.

    Explanation:

    The code snippet doesn't follow the correct form of writing a while loop, so it will crash when compiles.

    One correct form to write the code is:

    token = false;

    while (token) { / / Evaluate token, if true prints else terminates the loop. In this case, token is false so, no output and finish the program.

    print ("Hello");

    };
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What will be the output of the following code snippet? token = False while token : print ("Hello") A) "Hello" will continue to be displayed ...” 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