current position:Home>The second and third questions about the prime number determination, I feel that there is nothing wrong with it.

The second and third questions about the prime number determination, I feel that there is nothing wrong with it.

2022-09-23 02:40:51CSDN Q&A

The phenomenon and background of the problem encountered

img

Use the code block function to insert code, do not paste screenshots
#includeint main(){ int i,n,isprime=0; scanf("%d",&n); for(i=2;i<=n;i++){ if(n%i==0){ isprime=1; break; } } if(isprime==1||n==1) printf("No"); else printf("Yes"); return 0;}
Running results and error content

Randomly enter a prime number 37 to display no, and then debug the input number and no response

The result I want to achieve

Successfully solved the problem

copyright notice
author[CSDN Q&A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/266/202209161131461104.html

Random recommended