// I assume your array starts at 0 not 1 (and it should be 0)
int h=array[0];
int l=array[0];
int m=0,n=0;
// h = highest , l = lowest , m = h count , n = l count , right?
for(int z=0; z<=20; z++){
if(array[z] > h){
h = array[z];
}elseif(array[z] < l){
l = array[z];
}
}
//int q=1; -> what's this for
for(q=0;q<=20;q++){
if( array[q] == h ){
m++;
}
if( array[q] == l ){
n++;
}
}
cout << m << " students got the highest score of " << h << endl;
cout << n << " students got the lowest score of " << l << endl;