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:
%
%    19 June 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
