Ask Question
3 September, 12:07

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.

+4
Answers (1)
  1. 3 September, 12:31
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers