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

Name four behaviors that animals must use to survive
write a program in pascal to solve a quadratic equation
I am a number between 500 and 600. My Ones digit is 5. My tens digit is the difference between my ones and hundreds digits. Who am i
Peter jogged 96 yards in 40 seconds? What is his speed in feet per second?
Peter jogged 96 yards in 40 seconds? What is his speed in feet per second?
Caitlyn did 6/7 of the problems on her math correctly and 4 incorrectly. She did all the problems. How many were there?
write a program in pascal to solve a quadratic equation
Caitlyn did 6/7 of the problems on her math correctly and 4 incorrectly. She did all the problems. How many were there?
write a program in pascal to solve a quadratic equation
Ned weighs 1.5 times as much as Jill and Tom weighs 15 kilograms more than Jill. If their combined weight is 190 kilograms, how much does each person weigh?