首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的运行结果为【 】。 #include<math.h> #include<stdio.h> main() { int s=1; float n=1,pi=0; double t=1;
下列程序的运行结果为【 】。 #include<math.h> #include<stdio.h> main() { int s=1; float n=1,pi=0; double t=1;
admin
2013-06-11
24
问题
下列程序的运行结果为【 】。
#include<math.h>
#include<stdio.h>
main()
{ int s=1;
float n=1,pi=0;
double t=1;
while(fabs(t)>=2e-6)
{ pi+=t;
n+=2;
s=-s;
t=s/n;
}
pi*=4;
printf("pi=%.6f\n",pi);
}
选项
答案
3.141592
解析
转载请注明原文地址:https://kaotiyun.com/show/5tJp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
请读程序片段:charstr[]="ABCD",*p=str;printf("%d\n",*(p+4));上面程序片段的输出结果
有以下结构体说明和变量定义,如下图所示,指针p、q、r分别指向一个链表中的3个连续结点。structnode{intdata;structnode*next;}*p,*q,*r;现要将q和r所指结点的先
有以下函数定义:voidfun(intndoublex){…}若以下选项中的变量都已正确定义并赋值,则对函数fun的正确调用语句是()。
设a、b、c为整形数,且a=2,b=3,c=4则执行完以下语句后,a的值是【】。a*=16+(b++)-(++c);
一个C程序可以包含任意多个不同名的函数,但有且仅有一个______。
若有以下定义和语句: ihtw[2][3],(*pw)[3];pw=w; 则对w数组元素的非法引用是()
以下有4组用户标识符,其中合法的一组是______。
概要设计是软件系统结构的总体设计,不属于概要设计的是
下面四个选项中,均是不正确的八进制数或十六进制数的选项是
随机试题
正常菌群的有益作用不包括
A.白质脱髓鞘B.神经系统退变C.中枢神经变性D.节段性髓鞘破坏而轴突相对保留E.脊髓灰质炎病毒引起帕金森病是因为
房地产开发企业进行土地增值税清算时,对房地产开发企业将自行开发的房地产用于()的,应确认相应的收入计算缴纳土地增值税。
低成本策略强调降低银行成本,同时意味着成为一个低价格的竞争者。()
A股份有限公司共有资金1000万元。其中,普通股600万元,资本成本为25%;3年期银行借款400万元,年利率为9.9%,每年付息一次,到期一次还本,筹资费用率为1%;该公司所得税税率为25%。2016年该公司有甲、乙两个投资方案,初始投资额均为800万元
关于叶绿体色素的叙述,错误的是()。
党政机关公文处理工作应该坚持的原则是()。
Mortgageandotherfinancingincomedecreased$8.8.millionto$18.8.fortheyearendedDecember31,2006Thejncomein2006wa
【M1】______Applicationfilesarepiledhighlythismonthincollegesacrossthecountry.【M2】______Admissionsofficersareporing
Educationisnotanend,butameanstoanend.Inotherwords,wedonoteducatechildrenonlyforthepurposeofeducatingthe
最新回复
(
0
)