Ad Code

Write a program that prompts the user to input a number and prints its multiplication table

 Write a program that prompts the user to input a number and prints its multiplication table.

Code:

def print_multiplication_table(num):

    print("Multiplication table for", num, ":")

    for i in range(1, 11):

        print(num, "x", i, "=", num * i)


# Prompt the user to input a number

num = int(input("Enter a number: "))


# Print the multiplication table for the entered number

print_multiplication_table(num)


Reactions

Post a Comment

0 Comments