In this program, we will print the multiplication table of any number.
Steps to solve the program
- Take the number of which you want to print the table.
- Create a variable and assign its value equal to 0.
- Use a for loop to iterate over 1-10.
- Multiply the given number with the loop number and store the result in the created variable.
- Print the result after each iteration.
num = int(input("enter num="))
a = 0
for i in range(1,11):
a = i*num
print(i,"*",num,"=",a)
Output :
enter num=10
1 * 10 = 10
2 * 10 = 20
3 * 10 = 30
4 * 10 = 40
5 * 10 = 50
6 * 10 = 60
7 * 10 = 70
8 * 10 = 80
9 * 10 = 90
10 * 10 = 100