: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:

Recommended Answers

All 2 Replies

'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,

thank you for that.. very helpful!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.