Assignment 3

1. Ask a user for 20 numbers, must store in an array. Determine the largest and smallest number.

CPE102L
1Q1819
Code:
start
	int size=20
	int rane[size]
	int largest, smallest
	print “Enter 20 numbers:”
	for (int a=0; a<size; a++)
		input rane[a]
	end for
	largest=rane[0]
	smallest=rane[0]
	for (int a=0; a<size; a++)
		if (largest<rane[a])
			largest=rane[a]
		end if
		if (smallest>rane[a])
			smallest=rane[a]
		end if
	end for
	print “the largest number is “, largest, endl
	print “the smallest number is “, smallest,
end