网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
已知字符B的ACSII码值为66,下面程序的执行结果是: #include<stdio.h> main() { char ch=’A’; printf(“%c %dn”,ch,ch); }
参考答案和解析
B
更多 “已知字符B的ACSII码值为66,下面程序的执行结果是: #include<stdio.h> main() { char ch=’A’; printf(“%c %dn”,ch,ch); }” 相关考题
考题
有以下程序main( ){ char ch[]="uvwxyz",*pc ;pc =ch; printf("%c\n",*(pc+5));}程序运行后的输出结果是A)zB)0C) 元素 ch[5] 的地址D) 字符 y 的地址
考题
已知字母A的ASCII码为十进制的65,下面程序的输出为( )。void main(){ char ch1,ch2;ch1=’A’+’5’-’3’;ch2=’A’+6-3;printf("%d,%c\n",ch1,ch2);}A.67,D B.B,C C.C,D D.不确定的值
考题
有以下程序段char ch; int k;ch=′a′; k=12;printf("%c,%d,",ch,ch,k); printf("k=%d\n",k);已知字符a的ASCII码值为97,则执行上述程序段后输出结果是A.因变量类型与格式描述符的类型不匹配,输出无定值B.输出项与格式描述符个数不符,输出为零值或不定值C.a,97,12k=12D.a,97,k=12
考题
下列程序的功能是:求出ss所指字符串中指定字符的个数,并返回此值。例如,若输入字符串123412132,输入字符1,则输出3,请填空。#include#include#define M 81int fun(char *ss, char c){ int i=0;for(; ( );ss++)if(*ss==c)i++;return i;}main(){ char a[M], ch;clrscr();printf("\nPlease enter a string: "); gets(a);printf("\nPlease enter a char: "); ch=getchar();printf("\nThe number of the char is: %d\n", fun(a,ch));}
考题
在执行以下程序时,如果从键盘上输入ABCdef,则输出为______。include main(){char
在执行以下程序时,如果从键盘上输入ABCdef<回车>,则输出为______。#include <stdio.h>main (){ char ch; while ((ch=getchar())!="\n") { if (ch>='A' ch<='B')ch=ch+32; else if (ch>='a' ch<='z')ch=ch-32; printf("%c",ch); } printf("\n");}A.ABCdefB.abcDEFC.abcD.DEF
考题
已知字母A的ASCⅡ码为十进制数65,下面程序的输出结果是 ( ) main( ) {char ch1,ch2; ch1='A' + '5'-'3'; ch2='A'+'6'-'3'; printf("%d,%c\n",ch1,ch2); }A.67,DB.B,CC.C,DD.不确定的值
考题
执行下面的程序时,输入abc(其中CR代表回车),输出结果是()。includeinclude
执行下面的程序时,输入abc<CR>(其中CR代表回车),输出结果是( )。 #include<stdio.h> #include <string.h> main() { char ch; while((cn=getchar())!='n') { switch(ch-'a') { case 0: putchar(ch+1); case 1:putchar(ch+1);break; case 2:putchar(ch+2); caSe 3:putchar(ch+2);break; } } }A.abcB.bbcC.abcdD.bbcee
考题
有以下程序:includeunion pw{int i; char ch[2];}a;main(){a.ch[0]=13;a.ch[1]=0;prin
有以下程序: #include<stdio.h> union pw { int i; char ch[2]; }a; main() { a.ch[0]=13;a.ch[1]=0;printf("%d\n",a.i);} 程序的输出结果是( )。A.13B.14C.208D.209
考题
以下程序的输出结果是()。includecharcchar(chareh){if(ch>='A,ch
以下程序的输出结果是( )。 #include <stdio.h> charcchar(char eh) { if(ch>='A,ch<='Z') ch=ch-'A'+'a'; return ch; } main() { char s[]="ABC+abc=defDEF",*p=s; while(*p) { *p=cchsr(*p); p++; } printf("%s\n",s); }A.abc+ABC=DEFdefB.abc+abc=defdefC.abcABCDEFdefD.abcabcdefdef
考题
请编写函数fun(),它的功能是:求出ss所指字符串中指定字符的个数,并返回此值。例如,若输入字符串123412132,输入字符1,则输出3。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。试题程序:include<coio.h>include<stdio.h>define M 81int fun(char *ss,char c){}main(){ char a[M],ch;clrscr();printf("\nPlease enter a string:");gets(a);printf("\nPlease enter a char:");ch=getchar();printf("\nThe number of the char is:%d \n",fun(a,ch));}
考题
下面程序的运行结果是( )。include define SlZE 12 main() {char s[SIZE];int i;for(i=0
下面程序的运行结果是( )。include<stdio.h>define SlZE 12main(){char s[SIZE];int i;for(i=0;i<SIZE;i++) s[i]='A'+i+32;sub(s,5,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--;}}
考题
已知字母A的ASCII码为十进制数65,下面程序的输出结果是 ( ) main( ) { char ch1,ch2; ch1=A+5-3; ch2=A+6-3; printf("%d,%c\n",ch1,ch2); }A.67,DB.B,CC.C,DD.不正确定的值
考题
已知字母A的ASCII码为十进制的65,下面程序 main() { char ch1,ch2; ch1='A'+'5'-'3'; ch2='A'+'6'-'3'; printf("%d,%c\n",ch1,ch2); } 的输出是_________。A.67,DB.B,CC.C,DD.不确定的值
考题
下列程序运行时,若输入labcedf2df输出结果为【】。 include main(){char a=0,ch; wh
下列程序运行时,若输入labcedf2df<回车>输出结果为【 】。include<stdio.h>main(){ char a=0,ch;while((ch==getchar())!='\n'){ if(a%2!=0(ch>='a'ch<='z')) ch=ch'a'+'A';a++;prtchar(ch);}printf("\n");}
考题
下列程序(注意:ch[0]在低字节,ch[1]在高字节)的输出结果是______。includeunion pw{int
下列程序(注意:ch[0]在低字节,ch[1]在高字节)的输出结果是______。#include<stdio.h>union pw{ int i;char ch[2];}a;main (){ a.ch[0]=13;a.ch[1]=0; printf("%d\n",a.i);}A.13B.14C.208D.209
考题
以下程序运行后的输出结果是( )。 include main() {char ch[]="abcd",x[4][4];int i; f
以下程序运行后的输出结果是( )。 include<string.h> main() {char ch[]="abcd",x[4][4];int i; for(i=0;i<4;i++)strcpy(x[i],ch); for(i=0;i<4;i++)printf("%s",x[i][i]); printf("\n"); }
考题
运行下面程序时,从键盘输入字母H,则输出结果是includemain(){ char ch;ch=getchar();s
运行下面程序时,从键盘输入字母H,则输出结果是 #include<stdio.h> main() { char ch; ch=getchar(); switch(ch) { case 'H':printf("Hello!\n"); case 'G':printf("Good morning!\n"); default:printf("Bye_Bye!\n"); } }A.Hello!B.Hello! GoodMoring!C.Hello! Goodmorning! Bye_Bye!D.Hello! Bye_Bye!
考题
有以下程序: include main() {char ch1,ch2;int n1,n2;ch1=getchar();ch2=getehar();n1
有以下程序:include <stdio.h>main(){ char ch1,ch2;int n1,n2;ch1=getchar();ch2=getehar();n1=ch1-'0'; n2=n1*10+(ch2-'0');printf("%d\n",n2);}程序运行时输入:12<回车>,执行后的输出结果是【 】。
考题
已知字母A的ASCII码为十进制的65,下面程序的输出结果是( )。 main() { char ch1,ch2; ch1='A'+'5'-'3'; ch2='A'+'6'-'3'; printf("%d,"c/n",ch1,Ch2);}A.67,DB.B,CC.C,DD.不确定的值
考题
下面程序的输出结果是______。includemain(){char ch[7]={"12ab56"}; int i,s=0; for(i
下面程序的输出结果是______。 #include<stdio.h> main() { char ch[7]={"12ab56"}; int i,s=0; for(i=0;ch[i]>='0'ch[i]<='9';i+=2) s=10*s+ch[i]-'0'; printf("%d\n",s); }A.1B.1256C.12ab56D.1 2 5 6
考题
有以下程序: include main( ) { char ch=′Z′; ch=(ch-′A′+1)%26+′A′;putchar(ch); } 程序的运行结果是( )。
A.ZB.YC.BD.A
考题
有以下程序:includeunion pw{int i; char ch[2]; } a;main(){a.ch[0]=13; a.ch[1]=0;
有以下程序: #include <stdio.h> union pw { int i; char ch[2]; } a; main() { a.ch[0]=13; a.ch[1]=0; printf("%d\n",a.i); } 程序的输出结果是(注意:ch[0]在低字节,ch[1]在高字节)( )。A.13B.14C.208D.209
考题
在执行以下程序时,如果从键盘上输入:ABCdef,则输出为______。 main() { char ch; while((ch
在执行以下程序时,如果从键盘上输入:ABCdef<回车>,则输出为______。 main() { char ch; while((ch=getchar())!='\n') { if(ch>='A' ch<='Z') ch=ch+32; else if(ch>='a'ch<='2')ch=ch-32; printf("%c",ch); } printf("\n"); }A.ABCdefB.abcDEFC.abcD.DEF
考题
已知字母A的ASCII码为十进制的65,下面程序的输出是() main( ) { char ch1,ch2; ch1='A'+'5'-'3'; ch2='A'+'6'-'3'; printf(""%d,%c/n"",ch1,ch2);}A、67,DB)B、CC)C、DD)D、不确定的值
考题
单选题有以下程序#include main(){ char ch[]=uvwxyz,*pc; pc=ch; printf(%c,*(pc+5));}程序运行后的输出结果是( )。A
0B
zC
元素ch[5]的地址D
字符y的地址
考题
单选题有如下程序:#include void convert(char ch){ if(ch'D')convert(ch+1); printf(%c,ch);}main(){ convert('A'); printf(%);}程序运行后的输出结果是( )。A
ABCDDCBAB
ABCDC
AD
DCBA
考题
单选题已知字母A的ASCII码为十进制的65,下面程序的输出是() main( ) { char ch1,ch2; ch1='A'+'5'-'3'; ch2='A'+'6'-'3'; printf(""%d,%c/n"",ch1,ch2);}A
67,DB)B
CC)C
DD)D
不确定的值
考题
单选题有以下程序:#include main(){ char ch[3][5] = {AAAA,BBBB,CC}; printf(%s,ch[1]);}程序运行后的输出结果是( )。A
AAAAB
CCC
BBBCCD
BBBB
热门标签
最新试卷