Ask Question

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

+5
Answers (1)
  1. 8 May, 14:28
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a program that prints the number 1 through 10 using a while loop ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers