Computer Science
How many times does the following code execute ?
x = 1
while (x <= 5):
x + 1
print (x)
- 6
- 1
- 4
- 5
- infinite
Related Questions
When the following code runs, how many times is the line "x = x * 2" executed?
x = 1 while ( x < 20 ): x = x * 2What is the output when this code executes ?
x = 1 while (x <= 5): x + 1 print(x)What is the output produced when this code executes?
i = 1 while (i <= 7): i*= 2 print (i)Consider the following loop:
j = 10 while j >= 5: print("X") j=j-1Which of the following for loops will generate the same output as the loop shown previously?