jasminsanchez jasminsanchez
  • 16-11-2017
  • Computers and Technology
contestada

Write a program that prints the number 1 through 10 using a while loop

Respuesta :

Zepdrix
Zepdrix Zepdrix
  • 17-11-2017
Which programming language are you working in?

Here is how you could achieve this in Python:

establish a counter, starting at 1.
While your counter is 10 or less, do two things:
print the counter,
and increase the counter by 1.

code:
counter = 1

while counter <= 10:
print(counter)
counter = counter + 1

Those last two lines should be indented.
Answer Link

Otras preguntas

THE BOULDER takes issue with that comment.
2x + y = 4y = 3x - 1Is (1, 2) a solution to both equations? yes or no?​
A computer manufacturer sells his products at 40% higher then it costs to make. what is the selling price of the computer given the cost to make it? pzzzzzzzzz
Will mark the BEST answer as the BRAINIEST... PLz explain the ans too.... Why do you think there was so much opposition to the idea of vaccination?
20. Give an example of a controlled experiment and an observational study.
question is in picture, it’s about function rule.
Which is the graph of x^2/9 + y^2/4 = 1
Which phrase best describes the side of the moon that faces the Earth? Question 5 options: We always see random sides of the moon. We always see the left side o
What is the answer ?
How did the spanish and portuguese affect the economy of Latin America? PLEASE HELP FAST!!!