Traverse the array
for ( i = 0 ; i < N ; i ++ ) { sum += arr [ i ] ; } if ( sum == 0 ) document . write ( " " ) ; else if ( sum > 0 ) { if ( sum % K == 0 ) document . write ( " " ) ; else document . write ( " " ) ; } else document . write ( " " ) ; return 0 ; }