Assignment 3

3. Ask the user for 10 numbers, then reverse the order of the number in the array.

CPE102L
1Q1819
Code:
start

	int size=10, b=size-1
	int gtech[size]
	int temp
	
	print “Enter 10 numbers:”

	for (int a=0; a<size; a++)
		input gtech[a]
	end for
	
	for (int a=0; a<b; a++)
		gtech[a]=gtech[a]+gtech[b]
		gtech[b]=gtech[a]-gtech[b]
		gtech[a]=gtech[a]-gtech[b]
		b--;
end for

	print “the reverse of the numbers is: ”
	for (int a=0; a<size; a++)
		print gtech[a], “   “
end for

end