write a python program to find table of a number using while loop 1

write a python program to find table of a number using while loop

a=int(input("enter table number"))
b=int(input("enter the number to which table is to printed"))
i=1
while i<=b:
    print(a,"x",i,"=",a*i)
    i=i+1

Here is what the above code is Doing:
1. We are taking the input from the user for the table number and the number to which the table is to be printed.
2. We are initializing the variable i to 1.
3. We are using a while loop to print the table.
4. We are incrementing the value of i by 1 in each iteration.
5. We are printing the table till the value of i is less than or equal to the number to which the table is to be printed.

Similar Posts