Write a program in python to input a number and print its first five multiples
Answers
Answered by
174
Answer:
x=int(input("Enter a number : "))
for i in range(1,6):
print(i*x)
Explanation:
Hope it helps :-)
Answered by
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
Hindi,
5 months ago
Math,
5 months ago
English,
5 months ago
Social Sciences,
11 months ago
Science,
11 months ago
Social Sciences,
1 year ago