1)
//PRE: int a[] of size 30 is filled
#include
int main()
{
float summ = 0.0;
int numberOfStudentsWhoPassed = 0;
for (int i = 0; i < 30; ++i)
{
if (a[i] > 20)
{
summ+= a[i]; ++numberOfStudentsWhoPassed;
}
}
std::cout << "Average is " << summ/numberOfStudentsWhoPassed << endl;<br>}