And initialize arr [ i ] as 0 means the element ' i + 1' is not seen so far
arr [ i ] = 0 ; i ++ ; } } Console . Write ( " STRNEWLINE Below ▁ are ▁ counts ▁ of ▁ " + " all ▁ elements " + " STRNEWLINE " ) ; for ( int j = 0 ; j < n ; j ++ ) Console . Write ( j + 1 + " - > " + Math . Abs ( arr [ j ] ) + " STRNEWLINE " ) ; }