i try this and it work for me..
for (int n = 0; n < (dataGridView1.Rows.Count - 1); n++)
{
double i = Convert.ToDouble(dataGridView1.Rows[n].Cells["tamount"].Value.ToString().Replace('.', ','));
double j = Convert.ToDouble(dataGridView1.Rows[n].Cells["paymentamount"].Value.ToString().Replace('.', ','));
double total = i - j;
if (total >= 1)
{
dataGridView1.Rows[n].Cells["tamount"].Style.BackColor = Color.LightPink;
dataGridView1.Rows[n].Cells["paymentamount"].Style.BackColor = Color.LightPink;
}
else
{
dataGridView1.Rows[n].Cells["tamount"].Style.BackColor = Color.LightGreen;
dataGridView1.Rows[n].Cells["paymentamount"].Style.BackColor = Color.LightGreen;
}
}