% factors_bad.m
%  We are trying to print the prime factorization of N.
%  This program doesn't quite do it.
%
n = input ( '  Enter the value of N to factorize: ' );

while ( 1 < n )
  for i = 2 : n
    if ( mod ( n, i ) == 0 )
      fprintf ( ' %d', i );
      n = n / i;
    end
  end
end
fprintf ( '\n' );

