Ask Question
29 March, 15:23

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.

+3
Answers (1)
  1. 29 March, 16:11
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers