Computer Science, asked by nahu2, 11 months ago

Write a program in python to input a number and print its first five multiples

Answers

Answered by sswaraj04
174

Answer:

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

for i in range(1,6):

   print(i*x)

Explanation:

Hope it helps :-)

Answered by lovingheart
27

# Following is the function to print the first m multiple

def printmultiple(m, n):  

# inserts all elements from n to  

# (m * n)+1 incremented by n.  

a = range(n, (m * n)+1, n)  

 

print(*a)  

# The following code is a driver code  

m = 4

n = 5

printmultiple(m, n)

This program obtains the value for which multiples has to be generated and pass it to the function and the multiples are printed inside the function.

Similar questions