0

:eek: hi, Im new here, anyway i'm trying to work out how to get the smallest number from the user's input of four numbers, n1,n2,n3, and n4.. im a novice @ this so i'll copy the section of the program here and you can see whats going wrong with it..i have to work out 4 things, the total, the average, the smallest number and the biggest number... :rolleyes: ;)

begin
c:='a';//First Value Which Must Be<>q While (c<>'q')and(c<>'Q') do
begin
writeln('Now Please Choose From The Following Options');
writeln('(a) Calculate The Total');
writeln('(b) Obtain The Average');
writeln('(c) Find The Biggest Number');
writeln('(d) Find The Smallest Number');
writeln('(Q) Quit..!');
readln(c);
case c of
'a','A':writeln('You Entered Option a');
total:=(n1+n2+n3+n4);
writeln('The Total is ==> ',total);
'b','B':average:=n1+n2+n3+n4 div 4;
'c','C':small:=;
'd','D':writeln('You Entered Option (d)');
'q','Q':writeln('*****G O O D B Y E + G O O D R I D E N C E*****');
else writeln('**Error!! **Error!! Inncorrect Character!! Try Again');
end;
end;
readln;
end
end
end
end

end
.

any help would be apprecaited!!!

.Rom.:mrgreen:

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by Romillywinter
0

'b','B':average:=(n1+n2+n3+n4) div 4;

you can verify which is the smallest and biggest number when you are reading the variables.

best regards,

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.