Write a program to input an integer and check whether it is a prime number or not.
Answers
Answered by
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. ... So, if n is a prime number after the loop, flag will still be 0.
Similar questions