private string cal_grade() { string grade = ""; marks = Int32.Parse(markstb.Text); if (marks >= 87 && marks <= 100) { dataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.Yellow; grade = "A"; a++; Albl.Text = a.ToString(); } else if (marks >= 80 && marks <= 86) { grade = "B+"; bp++; Bpluslbl.Text = bp.ToString(); } else if (marks >= 72 && marks <= 79) { grade = "B"; b++; Blbl.Text = b.ToString(); } else if (marks >= 66 && marks <= 71) { grade = "C+"; cp++; Cpluslbl.Text = cp.ToString(); } else if (marks >= 61 && marks <= 65) { grade = "C"; c++; Clbl.Text = c.ToString(); } else if (marks >= 50 && marks <= 60) { grade = "D"; d++; Dlbl.Text = d.ToString(); } else if (marks <= 50) { grade = "F"; f++; Flbl.Text = f.ToString(); } return grade; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)