Answer:
I am writing a Python program.
integers = []
while True:
number = int(input("Enter integers (Enter negative number to end) "))
if number < 0:
break
integers.append(number)
print ("The smallest integer in the list is : ", min(integers))
print("The largest integer in the list is : ", max(integers))
Explanation:
integers[] is the list which contains the numbers entered by the user.
while loop continues to execute until the user enters a negative value.
input() function reads the input entered by the user and int(input()) accepts and reads the int (integer) type inputs entered by the user. number holds each input entered by the user and checks if that integer is less than 0 means user enters a negative value. If it is true then the loop breaks and if it is false then the every value stored in the number is added to the list integers.
append() method adds the elements into the list.
When the user enters a negative value, the while loop breaks and the program control moves to last two print statements.
The first print() statement uses min() function which computes the minimum value in the list integers.
The second print() statement uses max() function which computes the maximum value in the given list integers.
The screen shot of program along with its output is attached.