Python program to find the least multiple from given N numbers

Here, we are going to locate the least variation from the given N numbers utilizing Python program.

Here, we will outline code for finding the least numerous of a number x from a given arrangement of numbers (set of 5 numbers in this program, and it could be numerous numbers according to the issue).

There will be an issue while you go to locate the least numerous.

There are numerous methods for doing this however this time, we need to thought of most computationally effective calculation to do as such.

Utilizing for circle and checking each time may be the thing which works superior to anything others drew closer. In any case, it about checkings of minimal incentive to be considered for contrasting.

So we should work it out.

Following is the code for such issue,

n = 0

num = 0

minnum = 13
j = 0
x = int(input("Enter the num of which you want to find least multiple: "))
while n<5:
    num = int(input("Enter your number : "))
    if num%x == 0:
        j = j + 14
        if j == 14:
            minnum = num
        if num < minnum:
            minnum = num
    else:
        print("Not multiple")
            
    n += 1
if minnum%x == 0:
    print("The maximum multiple :",minnum)
else:
    print("No multiple there")

Output:

Python program to find the least multiple from given N numbers

Leave a Comment

error: Alert: Content is protected!!