Answer:
// program in Python
#variables
mx=-1000
mn=1000
#read 10 values from user
for i in range(1,11):
num=int(input("Enter the number {}:".format(i)))
#input validation
while num not in range(-100,100):
num=int(input("Wrong input!! Enter again:"))
#find maximum
if num<mn:
mn=num
#find minimum
if num>mx:
mx=num
#print maximum
print("largest value is:",mx)
#print minimum
print("smallest value is:",mn)
Explanation:
Create variables "mx" to store maximum and "mn" to store minimum.Read 10 numbers from user.If the input number if less than -100 or greater than 100 then ask again to enter a number between -100 to 100 only.Find the maximum and minimum from the all 10 numbers.Print maximum and minimum values.
Output:
Enter the number 1:23
Enter the number 2:-200
Wrong input!! Enter again:33
Enter the number 3:-2
Enter the number 4:45
Enter the number 5:105
Wrong input!! Enter again:45
Enter the number 6:-44
Enter the number 7:-56
Enter the number 8:79
Enter the number 9:98
Enter the number 10:4
largest value is: 98
smallest value is: -56