Computer Science, asked by mitulbora87, 8 months ago

write an algorithm to check whether the input number is prime number or not ​

Answers

Answered by Anonymous
4

Enter a positive integer: 29 29 is a prime number. In the program, a for loop is iterated from i = 2 to i < n/2 . If n is perfectly divisible by i , n is not a prime number. In this case, flag is set to 1, and the loop is terminated using the break statement.

Answered by rajrsharma2007
6

Answer:

Enter a positive integer: 29 29 is a prime number. In the program, a for loop is iterated from i = 2 to i < n/2 . If n is perfectly divisible by i , n is not a prime number. In this case, flag is set to 1, and the loop is terminated using the break statement.

Explanation:

I give you answer now it is your duty to mark me as a brianliest please follow me on brainly thanks my 10 answers

Similar questions