Ask the user to input a number less than 100. Print all the numbers from that number to 100.

Which loop correctly does this?


num = int (input("Enter a number between 1 and 100: "))
c = num

while (num 100):
print (c)
c = c + 1

num = int (input("Enter a number between 1 and 100: "))
c = num

while (c <= 100):
print (c)
c = c + 1

Respuesta :

Answer:

The second one:

num = int (input("Enter a number between 1 and 100: "))

c = num

while (c <= 100):

print (c)

c = c + 1

Explanation:

First of all, you don't know Python... (LEARN IT)

Second of all, The first loop doesn't make sense? num 100

And the second one works, you can try compiling it (lazy to explain...).

Answer:

num = int (input("Enter a number between 1 and 100: "))

c = num  

while (c <= 100):

  print (c)

  c = c + 1

Explanation: