Python program to find the maximum multiple from given N numbers

Here, we are going to locate the most extreme variation from the given N numbers utilizing python program.

Here, we will outline code for finding the greatest variety of a number x from a given arrangement of a number (arrangement of 5 numbers in this program).

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

Following is the code for such issue,

n = 0

num = 0

maxnum = 0

x = int(input("Enter the num of which you want to find highest multiple: "))

while n<5:
    num = int(input("Enter your number : "))
    if num%x == 0:
        if num > maxnum:
            maxnum = num
    else:
        print("Not multiple")
            
    n += 1

print("The maximum multiple :",maxnum)

Output:

Python program to find the maximum multiple from given N numbers

Leave a Comment

error: Alert: Content is protected!!