Ask Question
28 May, 11:32

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

var num = 10;

while (num <10)

{

num = num + 1;

}

+3
Answers (1)
  1. 28 May, 12:35
    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?
Get 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 & 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