for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
int x1 = int.Parse(dataGridView1.Rows[i].Cells[2].Value.ToString());
int x2 = int.Parse(dataGridView1.Rows[i].Cells[4].Value.ToString());
int x3 = x1 * x2;
int.Parse(dataGridView1.Rows[i].Cells[5].Value.ToString()) = x3;
}