Wednesday, 29 December 2021

To print the first ‘n’ multiples of a given number.

 

Python program to print multiples of a given number

The program to find the multiple sof a number in python is as follows:

 

# Owner : TutorialsInhand Author : Devjeet Roy

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

print("The multiples are: ")
for i in range(1,11):
    print(number*i, end =" ")

The output of the program to print multiples of a given number in python is as follows:

 

PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py
Enter number: 5
The multiples are:
5 10 15 20 25 30 35 40 45 50

No comments:

Post a Comment