function i4_to_triangle_upper_test ( )

%*****************************************************************************80
%
%% I4_TO_TRIANGLE_UPPER_TEST tests I4_TO_TRIANGLE_UPPER.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 August 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'I4_TO_TRIANGLE_UPPER_TEST\n' );
  fprintf ( 1, '  I4_TO_TRIANGLE_UPPER converts a linear index to an\n' );
  fprintf ( 1, '  upper triangular one.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   K  =>   I   J\n' );
  fprintf ( 1, '\n' );

  for k = 1 : 20

    [ i, j ] = i4_to_triangle_upper ( k );

    fprintf ( 1, '  %4d    %4d  %4d\n', k, i, j );

  end

  return
end
