有以下程序 main() { char s[]="abcde"; s+=2; printf("%d/n",s[0]); } 执行后的结果是()
第1题:
有下列程序:
main()
{char s[]="abcde";
s+=2;
printf("%d\n",s[0];
}
执行后的结果是( )。
A.输出字符a的ASCII码
B.输出字符c的ASCII码
C.输出字符c
D.程序出错
第2题:
若有如下程序; main() {char *p="china"; p+=1; printf("%d\n",p); } 则程序运行后的输出结果是 ( )
A.china
B.字符h的地址
C.hina
D.字符h的ASCII码值
第3题:
A.ASCII码值为2的字符
B.ASCII码值为1的字符
C.2
D.1
第4题:
下面程序段的运行结果是 #include<iostream.h> void main( ) { char*s="abcde"; S+=2; cout<<&s;}
A.cde
B.字符'c'
C.字符'c'的地址
D.无确定的输出结果
第5题:
以下程序运行后;输出结果是______。 main() { char*d[]={"ab","cde"}; printf("%x",d[1]); }
A.cde
B.字符c的ASCII码值
C.字符c的地址
D.出错
第6题:
下面程序段的输出结果是______。 char *s="abcde"; s+=2;printf("%d",s);
A.cde
B.字符'c'
C.字符'c'的地址
D.无确定的输出结果
第7题:
有以下程序(说明:字母A的ASCII码值是65)
#include
void fun(char *s)
{ while(*s)
{ if(*s%2) printf("%c",*s);
s++;
}
}
main()
{ char a[]="BYTE";
fun(a); printf("\n");
}
程序运行后的输出结果是
A.BY
B.BT
C.YT
D.Y
第8题:
有以下程序
#include<stdio.h>
main( )
{char s[]=“rstuv”;
printf(“%c\n”,*s+2);
}
程序运行后的输出结果是( )。
A.tuv
B.字符t的ASCII码值
C.t
D.出错
第9题:
数字字符'0'的ASCII值为48,若有以下程序: #include <stdio.h> main( ) char a='1',b ='2'; printf( "% c,",b + + ); printf(" % d \n" ,b - a); } 程序运行后的输出结果是( )。
A.3,2
B.50,2
C.2,2
D.2,50
第10题:
(25)有以下程序(说明:字母A的ASCII码值是65)
#include <stdio.h>
void fun(char *s)
{ while(*s)
{ if(*s%2) printf("%c",*s);
s++;
}
}
main()
{ char a[]="BYTE";
fun(a); printf("\n");
}
程序运行后的输出结果是
A)BY
B)BT
C)YT
D) YE
第11题:
输出字符a的ASCII码
输出字符c的ASCII码
输出字符c
程序出错
第12题:
BY
BT
YT
YE
第13题:
有以下程序: #include<stdio.h> main { char s[]="rstuv"; printf("%c\n",*s+2); } 程序运行后的输出结果是( )。
A.tuv
B.字符t的ASCIl码值
C.t
D.出错
第14题:
数字字符0的ASCII值为48,若有以下程序 main() { char a='1',b='2'; printf("%c,b++); printf("%d\n",b-a); } 程序运行后的输出结果是______。
A.3,2
B.3,1
C.2,1
D.2,2
第15题:
数字字符0的ASCII值为48,若有以下程序: main() { char a='1',b='2'; printf("%c,",b++); printf("%d\n",b-a); } 程序运行后的输出结果是 ______。
A.3,2
B.50,2
C.2,2
D.2,50
第16题:
已知字符'0'的ASCII码的十进制数为48,并且数组的第0个元素在低位,有以下程序 #include<stdio.h> main() { union{int i[2];long k:char c[4];}r,*s=&r; s->i[0]=0x39;s->i[1]=0x38;printf("%c\n",s->c[0]); } 程序运行后的输出结果是 ( )
A.39
B.9
C.38
D.8
第17题:
有以下程序 #inc1ude<stdio.h> void fun(char*s) { while(*s) { if(*s%2=0) printf("%c",*s); s++ } } main() { char a[]={"good"}; fun(A) ; prntf("n\"); } 注意:字母a的ASCII码值为97,程序运行后的输出结果是______。
A.d
B.go
C.god
D.good
第18题:
有以下程序(说明:字母A的ASCII码值是65)
#include<stdio.h>
void fun(char*S)
{while(*s)
{if(*s%2)printf(“%c”,*s);
S++;
}
}
main()
{char a[]=“BYTE”:
fun(a);printf(“\n”);
}
程序运行后的输出结果是
A.BY
B.BT
C.YT
D.YE
第19题:
有以下程序(注:字符a的ASCII码值为97)
#include<stdio.h>
main()
{ char*S={"abc"}:
do
{printf("%d",*s%10);++s;}
while(*s);
}
程序运行后的输出结果是
A.abc
B.789
C.7890
D.979899
第20题:
以下程序运行后的输出结果是______。 main() { char*s="abcde";s+=2;printf("%1d\n",s);}
A.cde
B.字符c的ASCII码值
C.字符c的地址
D.出错
第21题:
试题22
有以下程序(注:字符a的ASCII码值为97)()
#include <stdio.h>
main()
{ char *s ={“abc”};
do
{ printf(“%d”, *s%10); ++s;}
While(*s);
}
程序运行后输出结果是()
A.abc
B.789
C.7890
D.979899
第22题:
tuv
字符t的ASCII码值
t
出错
第23题:
abc
789
7890
979800