Calculate a massive A[n][m] elements which are randomized within the interval of [-5, 5], n and m, is inputted by user. Afterwards get all the positive numbers from each line and calculate the median.
On line 28 you update sum when you should be updating sum1, I think. If you wan the sum of each row you will have to reset sum1 before you start on a new row.
The problem description asks for the median and not the sum.