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

PLSSSSSSSSSSSSS HELPPPPPPPPPPPP Find the number if:
Someone help meh with this and tell me how u got this!
9. The_ and southern lights are created when parúcles from the solar wind interact with the Earth's magnetic field]
In general, the Mughal Empire supported A. women's rights. B. religious tolerance. C. artistic advancements. D. Christian beliefs.
You are given that 4a-2b = 10 (a) Write down the value of 2a - b
what are three examples of carbohydrate polymers?
Find the value mean value of 5,15,25,25,45.​
what sound causes the narrator to hasten or rush the murder of the old man? in the tell-tale heart by edgar allan poe​
i need solution for this question please ​
Type your response in the box. Review the writing prompt for your essay: Write a three-paragraph essay defining and explaining the idea of “change.” Now brainst