zero=0 pos=0 neg=1 for i=1 to n do for j=1 to m do if a[i][j]>0 then pos=pos+a[i][j] else if a[i][j]=0 then zero=zero+1 else neg=neg*a[i][j]