GİRDİĞİN 10 SAYI NEGATİF VE POZİTİF ORTAMALARINI BULAN PROGRAM
uses crt;
var
nt,pt,udt,eb,ek,a:integer;
i,ns,ps,ibs:byte;
nort:real;
begin
clrscr;
nt:=0; pt:=0; udt:=0; eb:=0; ek:=0; ns:=0; ps:=0; ibs:=0;
for i:=1 to 10 do
begin
write(i,'. SAYIYI GIRINIZ:'); readln(a);
if a<0 then
begin
ns:=ns+1;
nt:=nt+a;
end
else if a>0 then
begin
ps:=ps+1;
pt:=pt+a;
end;
if a>eb then eb:=a;
if a<ek then ek:=a;
if (a>200) and (a<500) then
begin
ibs:=ibs+1
end;
if (a>300) and (a<400) then
begin
udt:=udt+a
end;
end;
if ns<>0 then nort:=(nt/ns);
writeln('NEGAT˜F SAYILARIN ORTALAMASI:',nort);
writeln('POZ˜T˜F SAYILARIN SAYISI:',ps);
writeln('POZ˜T˜F SAYILARIN TOPLAMI:',pt);
writeln('200-500 ARASINDAK˜ SAYILARIN SAYISI:',ibs);
writeln('300-400 ARASINDAK˜ SAYILARIN ORTALAMASI:',udt);
writeln('GIRILEN EN BšYšK SAYI:',eb);
writeln('GIRILEN EN Kš€šK SAYI:',ek);
readln;
end.
|