Please enter a positive number: The number 29 is a prime number. A for loop is iterated from I = 2 to I n/2 in the program. n is not a prime number if it is perfectly divisible by i. Flag is set to 1 in this example, and the loop is ended using the break command.