Consider you already have table(DataGridview) with students marks. You need read those marks and calculate average marks. Then display the average in different table.
Reading students marks from table(Datagridview):
string studentName = "";
int english, maths, science, average;
BindingSource bs = (BindingSource) dataGridView1.DataSource;
DataTable dataTable = (DataTable) bs.DataSource;
DataTable dt = new DataTable();
dt.Columns.Add("Student_Name");
dt.Columns.Add("Average");
foreach (DataRow dr in dataTable.Rows)
{
studentName = dr["studentName"].ToString();
english = Convert.ToInt32(dr["English"]);
maths = Convert.ToInt32(dr["Maths"]);
science = Convert.ToInt32(dr["Science"]);
average = (english + maths + science)/3;
DataRow row = dt.NewRow();
row["Student_Name"] = studentName;
row["average"] = average;
dt.Rows.Add(row);
}
dataGridView2.DataSource = dt;