% nchoosek_row.m
%  Compute row N of Pascal's triangle, that is, nchoosek for k = 0:N.
%
n = input ( 'Enter the value of N: ' );

for k = 0 : n

  if ( k == 0 )
    value = 1;
  else
    value = value * ( n + 1 - k ) / k;
  end

  fprintf ( ' %d', value );

end

fprintf ( '\n' );
