已知字符‘7’的ASCII码值是55,请写出如下程序的输出结果: #include <stdio.h> int main() { char c=‘5’ ; printf(“%d",c+3); }
第1题:
下列程序的输出结果是( )。
#include<stdio.h>
VOid p(int *x)
{ printf("%d",++*x);
}
void main()
{ int y=3;
p(&y);
}
A.3
B.4
C.2
D.5
第2题:
以下程序的输出结果是 【7】 。
#include "stdio.h"
main()
{int a=065;
printf( "%d\n",--a);
}
第3题:
下面程序的输出结果是______。 #include<stdio.h> main() { char *p[]="BOOL","OPK","H","SP"}; int i; for(i=3;i>=0;i-,i-) printf("%c",*p[i]); printf("\n"); }
A.SO
B.SP
C.SPOPK
D.SHOB
第4题:
下面程序的输出结果是( )。 include<stdio.h> main() {static char a[]="china"; char*ptr=a; while(*ptr) {printf("%c",*ptr-32); ptr++; } }
第5题:
已知字符A的ASCII代码值为65,以下程序运行时,若从键盘输入:B33<回车>。则输出结果是______。 #include "stdio.h" main() { char a,b; a=getchar();scanf("Xd",&b); a=a-'A'+'0';b=b*2; printf("%c%c\n",a,b); }
A.2 B
B.1 B
C.3 B
D.4 B
第6题:
以下程序的输出结果是( )。 #include <stdio.h> main() { int i; for(i=1;i<5;i++) { if(i%2) printf("*"); else continue; printf("#"); } printf("$\n");
A.*#*#*#$
B.#*#*#*$
C.*#*#$
D.#*#*$
第7题:
以下程序的输出结果是【 】。
include<stdio.h>
main()
{ struct stru
{ int a;
float b;
char d[4];
};
printf("%d\n",sizeof(struct stru));
}
第8题:
已知字符0的ASCII码为十六进制的30,现有程序如下: #include <stdio.h> main() { union{ unsigned char c; unsigned int i[4]; }z; z.i[0]=0x39; z.i[1]=0x36; printf("%c\n",z.c); } 此程序的输出结果是( )。
A.6
B.9
C.0
D.3
第9题:
以下程序的输出结果是( ) # include<stdio.h> main() { union un{int i; long k; char c; }; struct byte{ int a; long b; union un c; } r; printf("%d\n",sizeof(r)); }
A.10
B.13
C.7
D.8
第10题:
已知在ASCII代码中,字母A的序号为65,下列程序的输出结果是______。#include <stdio.h>main (){ char c1='A',c2='Y'; printf("%d,%d\n",c1,c2);}
A.因输出格式不合法,输出错误信息
B.65,90
C.'A','Y'
D.65,89
第11题:
tuv
字符t的ASCII码值
t
出错
第12题:
abc
789
7890
979800
第13题:
已知字母a的ASCII码为十进制数97,下面程序的输出结果是( )。 #include<stdio.h> main() { char c1,c2; c1='a'+'6'-'0'; c2='a'+'3'-'0'; printf("%c,%c\n",c1,c2); }
A.输出无定值
B.d,e
C.e,f
D.g,d
第14题:
以下程序的输出结果是 ( ) #include<stdio.h> main() {struct stru{int a,b: char c[6]; }: printf("%d\n",sizeof(stru)), }
A.2
B.4
C.8
D.10
第15题:
请编写函数fun(),它的功能是:求出ss所指字符串中指定字符的个数,并返回此值。
例如,若输入字符串123412132,输入字符1,则输出3。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
include<coio.h>
include<stdio.h>
define M 81
int 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));
}
第16题:
若有如下程序; main() {char *p="china"; p+=1; printf("%d\n",p); } 则程序运行后的输出结果是 ( )
A.china
B.字符h的地址
C.hina
D.字符h的ASCII码值
第17题:
有以下程序:#include <stdio.h>#include <string.h>main( ) { char a[ 7 ] = "a0 \0a0 \0"; int i,j; i = sizeof(a); j = strlen(a); printf(" % d %d \n" ,i,j); }程序运行后的输出结果是( )。
A.22
B.76
C.72
D.62
第18题:
以下程序运行后;输出结果是______。 main() { char*d[]={"ab","cde"}; printf("%x",d[1]); }
A.cde
B.字符c的ASCII码值
C.字符c的地址
D.出错
第19题:
已知字母A的ASCII码值是65,字母a的ASCII码值是97,以下程序______。 main() { char a='A'; int b=20; printf("%d,%0",(a=a+a,a+b,b) ,a+'a'-'A',b); }
A.表达式非法,输出零或不确定值
B.因输出项过多,无输出或输出不确定值
C.输出结果为20,141
D.输出结果为20,141,20
第20题:
下列程序的输出结果是( )。 #include<stdio.h> main() { char a[]= {'a','b','c','d','e','f,'\0'}; int i,j; i=sizeof(a); j=strlen(a); printf("%d,%d",i,j); }
A.7,7
B.7,6
C.6,6
D.6,7
第21题:
下列程序的输出结果是( )。
#include<stdio.h>
main()
{ int a=4;
printf("%d\n",(a+=a-=a*A) );
}
A.-8
B.14
C.0
D.-24
第22题:
数字字符'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
第23题:
输出字符a的ASCII码
输出字符c的ASCII码
输出字符c
程序出错
第24题:
BY
BT
YT
YE