Ask Question
13 May, 19:10

What is the value of variable num after the following code segment is executed?

var num = 10;

while (num <10)

{

num = num + 1;

}

+1
Answers (1)
  1. 13 May, 20:30
    0
    num=10

    Explanation:

    Initial value of variable "num" is 10. When while loop execute for the first time, it checks the condition (num<10) and founds this FALSE. So the statement inside the while loop will not be executed. If while loop doesn't execute then it will not going to change the value of "num". That is why the value of "num" will remain same i. e. num=10.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What is the value of variable num after the following code segment is executed? var num = 10; while (num ...” 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