
{
PROGRAMMED BY   : MOHAMMAD ALJADA
DOWNLOADED FROM : WWW.GEOCITIES.COM/MOHJADA
PROGRAM         : Students Average
}

uses wincrt;
type arr=array[1..7] of integer;
var marks:array[1..101] of integer;
    mk:arr;
    n,i,sum:integer;


procedure mkproc(var mk:arr;n:integer);
begin
for i:=1 to n do
begin
if marks[i]>59 then mk[7]:=mk[7]+1;
if (marks[i]>=50) and (marks[i]<=59) then mk[6]:=mk[6]+1;
if (marks[i]>=40) and (marks[i]<=49) then mk[5]:=mk[5]+1;
if (marks[i]>=30) and (marks[i]<=39) then mk[4]:=mk[4]+1;
if (marks[i]>=20) and (marks[i]<=29) then mk[3]:=mk[3]+1;
if (marks[i]>=10) and (marks[i]<=19) then mk[2]:=mk[2]+1;
if (marks[i]>=0) and (marks[i]<=9) then mk[1]:=mk[1]+1;
end;
end;



BEGIN
write('Input Number Of Students : ');
readln(n);

randomize;
for i:=1 to n do
marks[i]:=random(100);

for i:=1 to 7 do
mk[i]:=0;

mkproc (mk,n);

writeln('Number Of Marks Between 0 and 9 is : ',mk[1]);
writeln('Number Of Marks Between 10 and 19 is : ',mk[2]);
writeln('Number Of Marks Between 20 and 29 is : ',mk[3]);
writeln('Number Of Marks Between 30 and 39 is : ',mk[4]);
writeln('Number Of Marks Between 40 and 49 is : ',mk[5]);
writeln('Number Of Marks Between 50 and 59 is : ',mk[6]);
writeln('Number Of Marks above   59 is        : ',mk[7]);
sum:=0;
for i:=1 to 7 do
sum:=sum+mk[i];
writeln;
writeln('Number Of Students is                : ',sum);
END.





