write a python program to print furst ten natural number using while loop
Answers
Answered by
4
The given problem is solved in language - Python.
i=1
while i<11:
print(i,end=' ')
i=i+1
- Line 1: Initialize i = 1 as we have to display first ten natural numbers.
- Line 2: Set a condition inside while loop to display numbers upto ten.
- Line 3: Print the number.
- Line 4: Increment the value of 'i' by 1.
1 2 3 4 5 6 7 8 9 10
** Process exited - Return Code: 0 **
See attachment for verification.
Attachments:
Answered by
0
Answer:
I have thanked your answers (◕ᴗ◕✿)
Similar questions