% Print all the prime numbers in [a,b].  a,b>0 and a<b.

a= input('Enter a positive integer: ');
b= input('Enter an integer greater than the previous value: ');

for n= a:b

    % Determine whether n is prime
    divisor= 2;
    while ( mod(n,divisor)~=0 )
        divisor= divisor + 1;
    end
    if (divisor==n)
        fprintf('%d is prime\n', n)
    end

end