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 Kings Park Register gives senior citizens a 10% discount on automotive ads. Mr. Quadrino, a senior citizen, is selling his car and wants to take out a 4-lin
In your opinion what drives a person to bully other people?
A payment made by a firm to its owners in the form of new shares of stock is called a _____ dividend.
A researcher is interested in understanding whether the number of people in a room affects how much a person eats. During the experiment, the researcher varies
Prove that √5 and 3√5 are irrational numbers.​
Three-fourths was subtracted from a number, and then 5 1/4 was added to the result. The sum was -7. 4 What was the original number?
How living things are highly organized
Geometry help, please.
Revise this passage to make it more unified and coherent. Add transitions between ideas, combine sentences, and make connections between information clearer.
how do anatomical similarities and differences between various organisms ( living and fossils) help infer lines of Evolutionary descent