here i have written the complete C++ program as per the requirement.
=========================================================
Program:
=========================================================
//header files
#include<iostream>
#include<cstdlib>
#include<ctime>
//namespace std
using namespace std;
//start of the main function
int main()
{
srand(time(0));
//an two dimensional array
int A[5][5], count = 0;
double sum = 0;
double B[5];
cout<<endl;
//display the marks
cout<<“The marks are: “<<endl<<endl;
//loop for 5 times
for(int i =0; i<5; i++)
{
//loop for 5 times
for(int j = 0; j<5; j++)
{
//generate random grades between 0 and 100
A[i][j] = rand()%101;
//display the number
cout<<A[i][j]<<” “;
}
cout<<endl<<endl;
}
//calculate the sum of grade of each column
for(int j = 0; j<5; j++)
{
while(count<5)
{
sum = sum + A[count][j];
count++;
}
count = 0;
//store the average on array B
B[j] = sum/5;
}
//display the average marks of each column
cout<<“The average for the marks are: “<<endl<<endl;
for(int i = 0; i< 5; i++)
{
cout<<B[i]<<endl<<endl;
}
return 0;
}
//end of the main function
=========================================================
Sample Output:

==========================================================