In this blog, we wrote about how to create n autonomous multiplication table generation in Python? don’t skip reading this blog and the contents are very crisp, just four lines of the program.

Algorithm:

Step-1: START

Step-2: First initialize n variable get input from the user, which table do you want?

Step-3: Next initialize the c variable get input from the user for how long you want a table length?

Step-4: Using for loop set range and iterate the table generation.

Step-5: In a print statement, we can use the multiplication operator n*i, print the sequence of table order

Step-6: STOP

Program in python:

n=int(input("Enter,Which table you want? "))
c=int(input("How long you want? "))
for i in range(1,c+1):
    print(n,"X",i,"=",n*i)

OUTPUT:

Enter,Which table you want? 5
How long you want? 10
5 X 1 = 5
5 X 2 = 10
5 X 3 = 15
5 X 4 = 20
5 X 5 = 25
5 X 6 = 30
5 X 7 = 35
5 X 8 = 40
5 X 9 = 45
5 X 10 = 50

Any queries leave a comment please and thanks for reading this post.

Leave a Reply

Your email address will not be published. Required fields are marked *