function value = i4vec_nonzero_count ( n, a )

%*****************************************************************************80
%
%% i4vec_nonzero_count() counts the nonzero entries in an I4VEC.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    17 April 2005
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the size of the input array.
%
%    integer A(N), an array.
%
%  Output:
%
%    integer VALUE, the number of nonzero entries.
%
  value = 0;

  for i = 1 : n
    if ( a(i) ~= 0 )
      value = value + 1;
    end
  end

  return
end
