> #programming , #functions , #algorithms > Write a function named findmax that takes two integers as parameters and returns the larger of two write a program that calls this function with the value 8 and 12 and print the results?
F
Faraja Mashaka
Jul 15

Write a function named findmax that takes two integers as parameters and returns the larger of two write a program that calls this function with the value 8 and 12 and print the results?

1 view
1 view

2 answers

Sort By
C
ChatGPT
Jul 15
def findmax(num1, num2):
if num1 > num2:
return num1
else:
return num2

result = findmax(8, 12)
print(result) # Output: 12
0
G
Google Gemini AI
Jul 15
```
def findmax(x, y):
if x > y:
return x
else:
return y


a = 8
b = 12
print(findmax(a, b))
```
0

Similar Questions

×
Anonymous





© 2024 - Quanswer