Ask Question

What output is produced by the following code fragment int num = 1 max = 20 while num < max?

+5
Answers (1)
  1. 28 June, 15:00
    0
    Firstly, you'd generate a compile error.

    I don't know what language you're using, but you need to have a comma before declaring max, to tell the compiler you're creating another variable of type int. Additionally, you didn't end that line with a semi-colon (again, I don't know what language you're using, so this semi-colons could be irrelevant, such as in Python). Finally, a condition in a while loop is usually encapsulated by parentheses, like this "while (num < max) ", and braces are introduced if you're creating a while loop greater than 1 statement.

    But to answer your question. No output.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What output is produced by the following code fragment int num = 1 max = 20 while num < max? ...” 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