Asked by A
Pseudocode and flowchart to create a program to find the smallest and largest value among 100 numbers. Display an appropriate
message for the smallest and largest numbers.
message for the smallest and largest numbers.
Answers
Answered by
oobleck
mink = maxk = 1
max = min = num(1)
for i=2..100 do
if min < num(i) then {min = num(i) ; mink = i}
if max > num(i) then {max = num(i) ; maxk = i}
next i
print "maximum is num(maxk) = max"
print "minimum is num(mink) = min"