clear; clc;

x = 57;
isPrime = true; % flag

for i = 2 : x - 1
    if mod(x, i) == 0
        isPrime = false;
        break; % early termination
    end
end

if isPrime
    disp('Is a prime.');
else
    disp('Not a prime.');
end