What's new

Help If STATEMENT PROGRAM

Sure! Here's a program in Python that determines the largest number among three numbers entered by the user:

Python:
# Function to find the maximum among three numbers
def find_maximum(a, b, c):
    if a >= b and a >= c:
        return a
    elif b >= a and b >= c:
        return b
    else:
        return c

# Get input from the user
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
num3 = float(input("Enter the third number: "))

# Call the function and store the result
maximum = find_maximum(num1, num2, num3)

# Display the result
print("The largest number among", num1, ",", num2, "and", num3, "is", maximum)

In this program, we define a function find_maximum that takes three numbers as input and returns the largest number among them using if-else statements. In the main part of the code, we prompt the user to enter the three numbers, call the find_maximum function, and then display the result.
 

Similar threads

Back
Top