#include
Void main () {int m, I, k;
Printf (" both please input a number: ");
The scanf (" % d ", & amp; M);
For (I=2; i<=m; I++) {if I==0) (m % {break; } else {printf (" % d is a prime \ n ", m); }
}
Printf (" % d is not a prime \ n ", m); }
CodePudding user response:
Because you are in for the else print, in the for to print outFor (I=2; i
}
If (I==m) printf (" % d is a prime \ "n, m);//on the outside for printing, otherwise only does not meet the if of a for loop will print
The else printf (" % d is not a prime \ "n, m);
CodePudding user response:
The last sentence clearly wrong, anyway, will show this sentence, illogical ah, suggested that get a pen and draw the flow chart, are helpful to improve the ability of programming,CodePudding user response:
In the last sentence, this code can be a big problemCodePudding user response: