重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 计算机类考试
网友您好,请在下方输入框内输入要搜索的题目:
搜题
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
题目内容 (请给出正确答案)
[主观题]

有以下程序#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

答案
查看答案
更多“有以下程序#include<stdio.h>#include<string.h>main(){char a[10]=”abcd”;prinff(“”相关的问题

第1题

有以下程序: #include < stdio. h > main () int a=3,b=4,c=5,d=2;if(a>b) if(b>c)printf("%d",

有以下程序: #include < stdio. h > main () int a=3,b=4,c=5,d=2; if(a>b) if(b>c)printf("%d",d++ +1); else printf("% d", + + d + 1 ); printf("% d \n" ,d); 程序运行后的输出结果是()。

A.2

B.3

C.43

D.44

点击查看答案

第2题

有以下程序#include<stdio. h>main(){charc1='1',c2='2';c1=getchar();c2=getchar();putchar(c1)

有以下程序#include<stdio. h>main(){ char c1='1',c2='2'; c1=getchar(); c2=getchar(); putchar(c1); putchar(c2);} 当运行时输入:a<回车> 后,以下叙述正确的是

A.变量c1被赋予字符a,c2被赋予回车符

B.程序将等待用户输入第2个字符

C.变量c1被赋予字符a,c2中仍是原有字符2

D.变量c1被赋予字符a,c2中将无确定值

点击查看答案

第3题

若有如下程序,则程序运行结果为:()#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)

A.=0

B.=1

C.=2

D.=3

点击查看答案

第4题

下列给定程序中,函数fun()的功能是;计算函数 F(x, y ,z)=(x+ y)/(x-y)+(z+ y)/(z-y)的值。其中x和

下列给定程序中,函数fun()的功能是;计算函数 F(x, y ,z)=(x+ y)/(x-y)+(z+ y)/(z-y)的值。其中x和y不相等,z和y不等。例如,当x的值为9,y的值为11,2的值为15时,函数值为-3.50。

请改正程序中的错误,使它能得出正确的结果。

注意:不要改动main 函数,不得增行或删行,也不得更改程序的结构。

试题程序:

include <stdio. h>

include <math. h>

/**************found******************/

define FU(m, n) (m/n)

float fun(float a, float b, float c)

{ float value;

value=FU(a+ b, a-b)+FU(c+ b, c-b);

/*************found******************/

return(Value);

}

main()

{ float x, y, z, sum;

printf ("Input x y z:: ");

scanf("%f%f%f", &x, &y, &z);

printf("x=%f, y=%f, z=%f\n ",x, y, z);

if (x==y||y==z) {printf ("Data error! \n ");

exit (0); }

sum=fun (x, y, z);

printf("The result is:%5. 2f\n ",sum);

}

点击查看答案

第5题

请编写函数fun(),该函数的功能是:移动字符串中的内容,移动的规则是把第1到第m个字符,平移到字符

请编写函数fun(),该函数的功能是:移动字符串中的内容,移动的规则是把第1到第m个字符,平移到字符串的最后,把第m+1到最后的字符移到字符串的前部。

例如,字符串中原有的内容为ABCDEFGHIJK,m的值为 3,移动后,字符串中的内容应该是DEFGHIJKABC。

注意:部分源程序给出如下。

请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。

试题程序:

include <stdio. h>

include <string.h>

define N 80

void fun (char *w, int m)

{

}

main ()

{

char a[N]= "ABCDEFGHIJK";

int m;

printf ("The origina string : \n");

puts (a);

printf("\n\nEnter m: ");

scanf ("%d", &m);

fun (a, m);

printf (" \nThe string after moving : \n");

puts (a);

printf ("\n\n");

}

点击查看答案

第6题

有以下程序()

A.#include

B.02356

C.0235

D.235

E.2356

点击查看答案

第7题

有以下程序()

A.#include

B.abcdef

C.ABCDEF

D.aBcDeF

E.AbCdEf

点击查看答案

第8题

有以下程序()

A.#include

B.5

C.24

D.32

E.40

点击查看答案

第9题

有以下程序()

A.#include

B.y=-1

C.y=0

D.y=1

E.while构成无限循环

点击查看答案

第10题

有以下程序 #include <stdio.h> int fun(int a, int b) { if(b==0) return a;

有以下程序 #include <stdio.h> int fun(int a, int b) { if(b==0) return a; else return(fun(-a,-b)); } main() { printf("%d\n",fun(4,2)); } 程序的运行结果是______。

A.1

B.2

C.3

D.4

点击查看答案

第11题

有以下程序#include<stdio.h>main(){int x=011;printf(“%d\n”,++x);}程序运行后的输出结果是

A.12

B.11

C.10

D.9

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案 购买前请仔细阅读《购买须知》
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《服务协议》《购买须知》
立即支付 系统将自动为您注册账号
已付款,但不能查看答案,请点这里登录即可>>>
请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝