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 Hudson River School was a style of painting that portrayed
(6+4)(2+3) Please simplify
48 = 10w + 6w what's the w
What might make stereotype self fulfilling?
What's the product for 2x2 7/8 as a mixed number?
What is the main idea of the story of Morte d’Arthur by Sir Thomas Malory? A. Sir Bedivere, King Arthur’s knight, betrays his king. B. King Arthur is mortally w
If a pair of shoes is 110$ how much is is with 50% off
If a poet wanted to write a love poem tha ended with a surprising twist, what poetic form would best fit this function A. Haiku B. Sonnet C. Sestina D. Ballad
A complement of an acute angles is acute
the pattern for a scarf is shown at the right.What is your he area of the scarf?