Computer Science, asked by manjukhalkho768, 7 months ago

ii. Write a program to input a number and check whether it is Prime or not.​

Answers

Answered by nsushma604
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.

Answered by patel444414
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.

Hope this help you

Please rate me!

Similar questions