![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
代码char* ch=”abcdef”;则输出*ch在控制台输入的结果是()
A.‘a’
B.“abcdef”
C.字符’a’的地址
D.“ab”
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)
A.‘a’
B.“abcdef”
C.字符’a’的地址
D.“ab”
设char strl[7]="ABCDEF",str2[5]="xyz";;则执行语句:
printf("%d",strlen(strcpy(str1,str2)));
后的输出是______。
#include<stdio.h>
main()
{
int a;
char ch;
ch="A":
scanf("%d",a);
printf("%c+%d=%c\n",ch,ch+a);
}
错误:______
改正:______
参考答案:错误
#include"stdio.h"
main()
{FILE*I=fp;char ch;
if((tp=fopen("test.txt","W"))==NULL)
{printf("cannot open file\n");exit(0);}
ch=getchar();
while(ch!='$')
{fputc(ch,fp);putchar(ch);
ch=getchar();}
fclose(*fp);
}
错误:______
改正:______
参考答案:错误
#include<stdio.h>
#include<conio.h>
main()
{
int i,j;
char ch;
while(ch=getchar()!='\r')
{
i++:
printf("%c",ch);
}
printf("you type%d characters\n",i);
}
错误:______
改正:______
参考答案:错误
下面程序的功能是将大写字母改成小字母,小字母改成大写字母。
main()
{char ch;
scanf("%c",&ch);
if(ch>='A'||ch<='Z')ch=ch+32;
elseif(ch>='a'&&ch<='z')ch=ch-32;
printf("%c",ch);
}
错误:______
改正:______
参考答案:错误
执行以下程序时,若输入end<回车>,则输出结果是【 】。 main() {char ch[10]="Begin"; gets(&ch[1]); puts(ch); }
下面程序的运行结果是【 】。 include<stdio.h> define SIZE 12 main() { char s[SIZE];int i;for(i=0;i<SIZE;i++) s[i]=A+i+321; sub(s,7,SIZE-1); for(i=0;i<SIZE;i++) printf("%c",s[i]); printf("\n");} sub(char *a,int t1,int t2) { char ch; while(t1<t1) { ch=*(a+t1); *(a+t1)=*(a+t2); *(a+t2)=ch; t1++;t2--;} }
下面程序的运行结果是【 】。 include<stdio.h> define SIZE 12 main() { char s[SIZE]; int I;for(I=0;I<SIZE;I++) s[I]=′A′+I+321; sub(s,7,SIZE-1); for(I=0;I<SIZE;I++) printf("%c",s[I]); printf("\n");} sub(char*a,int t1,int t2) { char ch; while (t1<t2) { ch=*(a+t1); *(a+t1)=*(a+t2); *(a+t2)=ch; t1++;t2--; } }
对下面说明叙述正确的是()
typedef struct stu
{int n;char ch[8];
}student;
A.student是结构体类型名
B.student是结构体变量
C.typedef struct是结构体类型
D.struct是结构体类型名