Algorithm for a program that generates 1000 random numbers between 0 and 100 000. Display the number of odd values generated as well as the smallest and the largest values. Output should be displayed in a windows message box.
Start
Declare variable integer min = 100000000
Declare variable integer max = -100000000
for i = 0 to 1000
Set number = generate random number
if number mod 2 == 1 then
Display number
if number < min then
min = number
end if
if number > max then
max = number
end if
end if
Display min
Display max
Stop
Comments
Leave a comment