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

Why should American citizens learn about the bombings of Hiroshima and Nagasaki?
what are bearings in maths?
what energy transformations take place in an A320
ashley decorates cakes and uses red icing to write a message on the cakes.She uses 10 1.2-ounces of red icing to write a message on 3 1.2 cakes.Based on this ra
a trampoline has an area of 49pi square feet what's the diameter of the trampoline
kirk bought songs for his mp3 player. he needs 6 more songs to have a total of 100. write an integer to represent how many more songs kirk needs.
If you don't like a certain food, you could hide much of its taste by A. closing your eyes. B. pinching your skin. C. biting your lip. D. holding your nose
~please only answer if you know for sure~ -Thank you-
What is the lateral area of the rectangular prism? Assume the prism is resting on its base. A. 200 in2 B. 180 in2 C. 90 in2 D. 50 in2
what changes in england were steps toward representative government