Computer Science, asked by shantanuthorat4, 6 hours ago

Write a program to check whether the number entered by the user is a prime number or not​

Answers

Answered by fidala300
0

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.

Mark Me As Brainlest ❤

Answered by NLanchenba
0

Explanation:

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.

Similar questions