rylieisboss9787 rylieisboss9787
  • 20-08-2019
  • Computers and Technology
contestada

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

var num = 10;

while ( num <10)
{

num = num +1;

}

Respuesta :

Mustela Mustela
  • 24-08-2019

Answer:

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.

Answer Link

Otras preguntas

What is 5x - 3 = 17?
The following function defines a recessive sequence: f(0) = -4f(1) = 12f(n) = -3•f(n -1) - 2•f(n - 2); for n > 1Which of the following sequences is defined b
Perform the indicated in operation and write in standard form. (2-3i)+(4+8i)
conservation between hitler and gandhiji (10 exchange)
Show that sum of any two medians of a triangle is greater than the third median.
What is 5x - 3 = 17?
I don't know if I'm right but, is this "No Solution", or am I wrong?....Please Help! (;
I need an essay on letter's importance in hindi
Hey! Can you help out a bit?
I need an essay on letter's importance in hindi