Ask Question
22 January, 02:31

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

+2
Answers (1)
  1. 22 January, 04:33
    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?
Get an answer to your question ✅ “Write a program that prints the number 1 through 10 using a while loop ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers