current position:Home>Enter N and n positive integers and output all prime numbers. If not, output No

Enter N and n positive integers and output all prime numbers. If not, output No

2022-02-02 21:46:58 CSDN Q & A

img


In the inner circle if The statement does not appear to have been executed ︽⊙_⊙︽




Refer to the answer 1:

scanf("%d",&m) Put it in for Outside of the loop
Outer layer for Cycle is for(i=n;i<=m;i++)
Inner layer for Before the cycle , Reset required flag=1
Inner layer for The loop should be for ( j =2;j<sqrt((double)i);j++)




Refer to the answer 2:

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

Random recommended