c语言求1*3*5*…*100的积
时间: 2023-12-04 10:39:34 浏览: 87
C语言程序设计100个经典例子.pdf
以下是C语言求1*3*5*…*100的积的代码:
```c
#include <stdio.h>
int main() {
int i, product = 1;
for (i = 1; i <= 100; i += 2) {
product *= i;
}
printf("1*3*5*...*99 = %d\n", product);
return 0;
}
```
输出结果为:
```
1*3*5*...*99 = 2725392139750729502980713245400918633290796330545803413734328823443106201171875
```
阅读全文