c语言把1~100之间能被7整除的数,以每行5个的形式在屏幕上输出
时间: 2024-05-03 19:20:52 浏览: 86
Sure, here's the C code to output all numbers between 1 and 100 that are divisible by 7, in rows of 5:
```c
#include <stdio.h>
int main()
{
int i;
for (i = 1; i <= 100; i++)
{
if (i % 7 == 0)
{
printf("%d ", i);
if (i % 35 == 0)
printf("\n");
}
}
return 0;
}
```
I hope that helps!
阅读全文