write a python program to print the table of a number using 'while' loop?
Answers
Answered by
2
Answer:
The given program is written in Python.
i,n=1,int(input("Enter a number: "))
print(f"Table of {n} is:")
while i<=10:
print(f"{n} x {i} = {n*i}")
i+=1
Algorithm:
- Accept the number.
- Loop through numbers in the range 1 to 10.
- Display the product of the number and the loop variable.
Refer to the attachment for output.
•••♪
Attachments:
Answered by
0
Please, refer the jpg for your question.
Input:
a=int(input("Enter a number: "))
i=1
while i<=10:
print(a, '*' ,i, '=' ,a*i)
i+=1
Attachments:
Similar questions