Computer Science, asked by harshitverma2345, 2 months ago

write a python program to print the table of a number using 'while' loop?​

Answers

Answered by anindyaadhikari13
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:

  1. Accept the number.
  2. Loop through numbers in the range 1 to 10.
  3. Display the product of the number and the loop variable.

Refer to the attachment for output.

•••♪

Attachments:
Answered by SOOP2
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