单项选择题
以下程序的功能是计算: 。 #include <stdio.h> main() int n; float s; s=1.0; for(n=10;n>1;n--) s=s+1/n; printf("%6.4f\n",s); 程序运行后输出结果错误,导致错误结果的程序行是()。
A. s=1.0; B. for(n=10;n>1;n--) C. s=s+1/n; D. printf("%6.4f\n",s);
A. 5 B. 3 C. 20 D. 10
A. n=0; do ++n; while (n<=0); B. n=0; while (1) n++; C. n=10; While (n); n--; D. for(n=0, i=1; ;i++)n+=i