Write+a+program+to+find+all+prime+numbers+between+100+and+200.C
时间: 2023-12-10 21:04:46 浏览: 160
c代码-输出100~~200之间所有的奇数
```c
#include <stdio.h>
int main() {
int i, j, flag;
printf("Prime numbers between 100 and 200 are: ");
for (i = 100; i <= 200; i++) {
flag = 0;
for (j = 2; j <= i / 2; j++) {
if (i % j == 0) {
flag = 1;
break;
}
}
if (flag == 0) {
printf("%d ", i);
}
}
return 0;
}
```
--相关问题--:
1. 请问什么是质数?
2. 如何判断一个数是否为质数?
阅读全文