题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-20 00:26:29

[单项选择]以下程序:
#include<stdio.h>
main( )
char str[10];
scanf("%s",&str);
printf("%s/n",str);

运行上面的程序,输入字符串how are you,则程序的执行结果是()。
A. how
B. how are you
C. h
D. howareyou

更多"以下程序: #include<stdio.h> main( ) "的相关试题:

[单项选择]下列程序的输出结果是 #include void main( ) { char * str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!=’/0’;i++) switch(str[i]) { case’1’:x4++; case’2’:x3++; case’3’:x2++; case’4’:x1++; } cout < < x1 < < "," < < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[单项选择]下列程序的输出结果是
#include
void main( )
char * str="12123434";
int x1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!=’/0’;i++)
switch(str[i])
case’1’:x4++;
case’2’:x3++;
case’3’:x2++;
case’4’:x1++;

cout < < x1 < < "," < < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[单项选择]有以下程序 #include main( ) {char c1,c2,c3,c4,c5,c6; scanf("%c%c%c%C",8az1,&z2,&c3,&c4); c5=getchar( );c6:getchar( ); putchar(c1);putchar(c2); printf("%c%c\n",c5,c6); } 程序运行后,若从键盘输入(从第l列开始) 123<回车> 45678<回车> 则输出结果是【 】。
A. 1267
B. 1256
C. 1278
D. 1245
[填空题]以下程序的输出结果是______。
#include
main( )
char *ch[4]=("red ","green","blue");
int i=0;
while(ch[i])
putchar(ch[i][0]);i++;

[填空题]有以下程序:
main( )
char str[]="xyz", *ps=str;
while(* ps)ps++;
for(ps--; ps-str>=0;ps--)puts(ps);

执行后的输出结果是 【3】
[填空题]有以下程序: main( ) {char str[]="xyz", *ps=str; while(* ps)ps++; for(ps--; ps-str>=0;ps--)puts(ps); } 执行后的输出结果是 【3】
[单项选择]

有以下程序
#include
main( )
{ char b,c;int i;
b=’a’; c=’A’;
for(i=0;i<6;i++)
{ if(i%2) putchar(i+B);
else putchar(i+C);
}
printf("/n");
}
程序运行后的输出结果是()。


A. ABCDEF
B. AbCdEf
C. aBcDeF
D. abcdef
[单项选择]有以下程序
#include
main( )
char p[20]=’a’,’b’,’c’,’d’,q[ ]="abc",r[ ]="abcde’;
strcat(p,r) ;strcpy(p+strlen(q),q);
printf("%d/n",strlen(p));

程序运行后的输出结果是
A. 9
B. 6
C. 11
D. 7
[单项选择]有以下程序:
#include
main( )
FILE*pf;
char*s1="China",*s2;"Beijing";
pf=fopen("abc.dat","wb+");
fwrite(s2,7,1,pf);
rewind(pf);/*文件位置指针回到文件开头*/
fwrite(s1,5,1,pf);
fclose(pf):

以上程序执行后abc.dat文件的内容是( )。
A. China
B. Chinang
C. ChinaBeijing
D. BeijingChina
[填空题]当运行以下程序时,输入abcd,程序的输出结果是【 】 insert(char str[]) {int i; i=strlen(str); while(i>0) {str[2*i]=str[i];str[ 2*i-1]=’’*’’;i--;} printf("%S\n",str); } main( ) {char str[40]; scanf("%S",str);insert(str); }
[填空题]有以下程序:
main( )
char str[]="xyz", *ps=str;
while(* ps)ps++;
for(ps--; ps-str>=0;ps--)puts(ps);

执行后的输出结果是
[填空题]当运行以下程序时,输入abed,程序的输出结果是: 【9】 。 insert(char str[]) {int i i=strlen(str); while(i>0) {str[2*i]=str[i];str[2*-1]=’*’;i--; } printf("%s/n",str); } main( ) {char str[40]; scanf("%s",sB) ; insert(str); }
[填空题]当运行以下程序时,输入abcd,程序的输出结果是 【19】
insert(char str[ ] )
int i;
i = stolen(str);
while (i>0)
str[2*i] =str[i]; str[2 * i-1] = ’* ’; i--;
printf( "% s /n", sir);main( )
char str[40];
seanf( "% s" ,str); insert(str);

[填空题]以下程序的输出是 【7】 。 main( ) { char str1[]=How do you do",*p=strl; strcpy(str1+strlen(str1)/2"es she"); pfinff("%s/n",p1); }

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码