How to find this average for this programm read 3 grades for students
#include <iostream>
#include <string>
using namespace std;
const int arr_size = 30;
const int name_size = 20;
void f_name_s(char name[name_size][arr_size], int math[arr_size],int history[arr_size],int physics[arr_size],int& num_s);
void display_arr(char dstuds[name_size][arr_size], int math[arr_size],int history[arr_size] ,int physics[arr_size], int stud_num);
//*********************************************************
void f_name_s(char name[name_size][arr_size],int math[arr_size],int history[arr_size],int physics[arr_size], int& num_s)
{
int count;
cout<<"Enter the number of students >> " ;
cin>>num_s;
for(count=0; count<num_s; count++)
{
cout<<"Enter the name of the student " << count+1<<": ";
cin>>name[count];
cout<<"Enter the grade for maths " << count+1<<": ";
cin>>math[count];
cout<<"Enter the grade for history " << count+1<<": ";
cin>>history[count];
cout<<"Enter the grade for physics " << count+1<<": ";
cin>>physics[count];
}
}
//*********************************************************
void display_arr(char dstuds[name_size][arr_size], int math[arr_size], int history[arr_size] , int physics[arr_size], int d_stud_num)
{
int d_count , count ;
cout<< "Name"<< " "<<"Math Grade"<< "History Grade "<< " Physics Grade "<< endl;
for(d_count=0; d_count<d_stud_num; d_count++)
{
cout << dstuds[d_count]<< " " ;
cout << math[d_count] << endl ;
cout << history[d_count] << endl ;
cout << physics[d_count] << endl ;
}
}
//**********************************************************
int main ()
int count;
for (count=0; count ==
//*********************************************************
int main(){
int stud_num;
char stud_arr[name_size][arr_size];
int math[arr_size];
int history[arr_size] ;
int physics [arr_size] ;
f_name_s(stud_arr, math, history, physics , stud_num);
display_arr(stud_arr, math, history, physics ,stud_num);
system("pause");
return 0;
}