64.3k views
23 votes
Create a function called biggestNum that returns the largest number in an array of integers. The function is passed only one parameter, an array. In main, ask the user the input eight integers. Each integer should be added to an array called nums. Then, call the function and output the largest number in the array.

Create a function called biggestNum that returns the largest number in an array of-example-1

1 Answer

4 votes

This is for Python

def biggestNum():

array = []

for i in range(8):

number = int(input('Enter number: '))

array.append(number)

return max(array)

print(biggestNum())

User SergioR
by
4.8k points