Computer Science, asked by deekshamehra2005, 1 month ago

write a python program to print furst ten natural number using while loop​

Answers

Answered by anindyaadhikari13
4

\textsf{\large{\underline{Solution}:}}

The given problem is solved in language - Python.

i=1

while i<11:

   print(i,end=' ')

   i=i+1

\textsf{\large{\underline{Explanation}:}}

  1. Line 1: Initialize i = 1 as we have to display first ten natural numbers.
  2. Line 2: Set a condition inside while loop to display numbers upto ten.
  3. Line 3: Print the number.
  4. Line 4: Increment the value of 'i' by 1.

\textsf{\large{\underline{O{u}tput}:}}

1 2 3 4 5 6 7 8 9 10  

*‎* Process exited - Return Co‎de: 0 *‎*

See attachment for verification.

Attachments:
Answered by queenofsnow44
0

Answer:

I have thanked your answers (◕ᴗ◕✿)

Similar questions