function i4vec_max_index_last_test ( )

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

  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4vec_max_index_last_test():\n' );
  fprintf ( 1, '  i4vec_max_index_last():     last maximal index;\n' );

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

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

  fprintf ( 1, '\n' );

  ival = i4vec_max_index_last ( n, a );
  fprintf ( 1, '  Last maximum index: %d\n', ival );

  return
end
