function i4vec_value_index_test (  )

%*****************************************************************************80
%
%% i4vec_value_index_test() tests i4vec_value_index().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  n = 25;
  value = 3;
  max_index = 3;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4vec_value_index_test():\n' );
  fprintf ( 1, '  i4vec_value_index() indexes entries equal to\n' );
  fprintf ( 1, '  a given value.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The desired value is ', value );
  fprintf ( 1, '  The maximum number of indices to find is %d\n', max_index );

  b = 1;
  c = 5;

  a = randi ( [ b, c ], n, 1 );

  i4vec_print ( n, a, '  Input vector A:' );

  [ n_index, value_index ] = i4vec_value_index ( n, a, value, max_index );

  i4vec_print ( n_index, value_index, ...
    '  Indices of entries equal to given value: ' );

  return
end
