Start
└─ Input a number n
└─ Set is_prime = True
└─ If n is less than 2
└─ Set is_prime = False
└─ Otherwise
└─ For each number i from 2 to n - 1
└─ If n is divisible by i
└─ Set is_prime = False
└─ Exit the loop
└─ If is_prime is True
└─ Output "n is a prime number"
└─ Otherwise
└─ Output "n is not a prime number"
End
Đúng 0
Bình luận (0)