function i4vec_index_test ( )

%*****************************************************************************80
%
%% i4vec_index_test() tests i4vec_index();
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 April 2009
%
%  Author:
%
%    John Burkardt
%
  n = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4vec_index_test():\n' );
  fprintf ( 1, '  i4vec_index():              first index of given value;\n' );

  a = randi ( [ -n, n ], n );

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

  fprintf ( 1, '\n' );

  aval = a(floor(n/2));
  fprintf ( 1, '\n' );
  j = i4vec_index ( n, a, aval );
  fprintf ( 1, '  Index of first occurrence of %d is %d\n', aval, j );

  aval = aval + 1;
  j = i4vec_index ( n, a, aval );
  fprintf ( 1, '  Index of first occurrence of %d is %d\n', aval, j );

  return
end
