更多“有以下程序:include<stdio.h>in…”相关的问题
第1题
若有如下程序,则程序运行结果为:()#include<stdio. h>main(){ int x=1, a=0;switch (x)case 1:a++;case 2: a++ ;break;case 3: a++ ; break;printf(”a=%d\n" ,a)
点击查看答案
第2题
请编写函数fun(),该函数的功能是:计算并输出 S=1+(1+20.5)+(1+20.5+30.5)+…+(1+20.5+30.5+…+n0.5
请编写函数fun(),该函数的功能是:计算并输出
S=1+(1+20.5)+(1+20.5+30.5)+…+(1+20.5+30.5+…+n0.5)
例如,若主函数从键盘给n输入20后,则输出为
s=534.188884。
注意;部分源程序给出如下。
请勿改动主函数main 和其他函数中的任何内容,仅在函数fun 的花括号中填入所编写的若干语句。
试题程序:
include <math. h>
include <stdio. h>
double fun(int n)
{
}
main()
{
int n;
double s;
printf("\n\nInput n: ");
scanf ("%d", &n);
s=fun (n)
printf ("\n\ns=%f\n\n", s);
}
请帮忙给出正确答案和分析,谢谢!
点击查看答案
第3题
有以下程序()
A、#include
B、abcdef
C、ABCDEF
D、aBcDeF
E、AbCdEf
点击查看答案
第5题
有以下程序()
A、#include
B、5
C、24
D、32
E、40
点击查看答案
第6题
有以下程序()
A、#include
B、x=4
C、x=8
D、x=6
E、x=12
点击查看答案
第7题
有以下程序#include<stdio.h>#include<string.h>main(){char a[10]=”abcd”;prinff(“
有以下程序
#include<stdio.h>
#include<string.h>
main()
{char a[10]=”abcd”;
prinff(“%d,%d\n”,strlen(A),sizeof(A));
}
程序运行后的输出结果是
A.7,4
B.4,10
C.8,8
D.10,lO
请帮忙给出正确答案和分析,谢谢!
点击查看答案
第8题
有以下程序()
A、#include
B、y=-1
C、y=0
D、y=1
E、while构成无限循环
点击查看答案
第9题
有以下程序#include<stdio.h>main(){int x=011;printf(“%d\n”,++x);}程序运行后的输出结果是
点击查看答案
第10题
有以下程序: #include #include main() { char str[ ]={"Hello,Beijing"}; printf("%d,%d\n",strlen(str),sizeof(str)); } 程序的运行结果是()。
A.13,13
B.13,14
C.13,15
D.14,15
请帮忙给出正确答案和分析,谢谢!
点击查看答案