When I try to run the following code it gives an error which is \" Cannot implicitly convert type \'float\' to \'int\' \".
I have done a lot of searches, and sadly I was
Since h, twoEnds, and x are all floats, the following equation will return a float:
h
twoEnds
x
sum1 = (h - ((cols) * x) + twoEnds)) / (cols + 1)
You can either change sum1 to be a float, or cast your equation to be an int like so:
sum1 = (int)((h - ((cols) * x) + twoEnds)) / (cols + 1));