for (int col = 0; col < 9; col++) {
for (int row = 0; row < 3; row++) {
dataGridView5->Rows[3]->Cells["col8"]->Value=Convert::ToString(Convert::ToDouble(dataGridView5->Rows[2]->Cells["col8"]->Value)+Convert::ToDouble(dataGridView5->Rows[1]->Cells["col8"]->Value)+Convert::ToDouble(dataGridView5->Rows[0]->Cells["col8"]->Value));
}
this code for sum cells
if all cells has value more than 0 the code is working
but if any cell value = 0 the code give the result plus 1 ex… cell1=5 cell2=0 the result cell=6
how can i solve it ?
if all cells has value more than 0 the code is working
but if any cell value = 0 the code give the result plus 1 ex… cell1=5 cell2=0 the result cell=6
how can i solve it ?
c++ languge
New contributor
Mahmoud Abozied is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2