单选题有以下程序: main() char a[7]="a0/0a0/0"; int i, j; i=sizeof(a); j=strlen(a); printf("%d%d/n", i, j); 程序运行后的输出结果是 A) 2 2 B) 7 6 C) 7 2 D) 6 2
单选题以下程序段中,不能正确赋字符串(编译时系统会提示错误)的是______。 A) char s[10]="abcdefg"; B) char t[]="abcdefg", * s=t; C) char s[10]; s="abcdefg"; D) char s[10]; strcpy(s, "abcdefg");
单选题有以下程序#includemain() int i,j;for(i=3;i>=1;i--) for(j=1;j<=2;j++) printf("%d ",i+j);printf("/n");程序运行的结果是______。(A) 2 3 4 3 4 5(B) 4 3 2 5 4 3(C) 2 3 3 4 4 5(D) 4 5 3 4 2 3
单选题有以下程序 #include<stdio.h> #include<string.h> Struct A { int a;char b[10];double c;}; struct A f(struct A t); main() { struct A a={1001,"ZhangDa",1098.0}; a=f(a);printf("%d,%s,%6.1 f\n",a.a,a.b,a.c);} struct A f(Struct A t) {t.a=1002;strcpy(t.b,"ChangRong");t.c=1202.0;return t;}程序运行后的输出结果是
单选题下列程序的输出结果是______。main() int n; (n=6*4,n+6),n*2; printf("n=%d/n",n);
单选题有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数):
#include<stdio.h>
#include<string.h>
main()
{char a[10]="abc", b[10]="012", c[10]="xyz";
strcpy(a+1, b+2);
puts(strcat(a, c+1));
}
程序运行后的输出结果是______。
单选题下面选项中合法的字符常量是
单选题已有定义:char c;,程序前面已在命令中包含ctype.h文件。不能用于判断c中的字符是否为大写字母的表达式是
单选题以下叙述中正确的是______。
单选题有以下程序:
# include <stdio.h>
main()
{ char a="H";
a=(a>="A"&&a<="Z")?(a-"A"+"a"):a;
printf("%c/n",a);
}
程序运行后的输出结果是______。
单选题常采用的两种存储结构是( )。 A) 顺序存储结构和链式存储结构 B) 散列方法和索引方式 C) 链表存储结构和数组 D) 线性存储结构和非线性存储结构
单选题有以下程序:
#include
main()
{ int a=0,b=0,c=0,d=0;
if(a=1)b=1;c=2;
else d=3;
printf(“%d,%d,%d,%d\n”,a,b,c,d);
}
}
程序的运行结果是( )。
单选题设有课程关系模式:R(C#,Cn,T,TA)(其中,C#为课程号,Cn为课程名,T为教师名,Ta为教师地址)并且假定不同课程号可以有相同的课程名,每个课程号下只有一位任课教师,但每位教师可以有多门课程。关系R中对主属性的传递依赖为
单选题以下程序的输出结果是 main() int a,i=a=0; for(i=1;i<5;i++) switch(i) case 0: case 3:a+=2; case 1: case 2:a+=3; default:a+=5; printf("%d/n",
单选题以下程序的输出结果是______。 main() chsr st[20]="bello/0/t//"; print("%d%f/n",strlen(st),sizeof(st)); A) 99 B) 520 C) 1320 D) 2020
单选题有以下程序: main() {
char s[]="Yes/n/No",*ps=s; puts(ps+4);
*(ps+4)=0; puts(s);
} 程序运行后的输出结果是(选项D中的第一行是空行) ( )。
A. n/No Yes /No
B. /No Yes
C. /No Yes /No
D. /No Yes
单选题若有定义:int a[4][10];,则以下选项中对数组元素a[i][i]引用错误的是______。(0<=i<4,0=i<10)
单选题有以下函数 int fun(char *x,char *y) int n=0; while((*x==*y) y++; n++; return n; 函数的功能是( )。 A)查找x和y所指字符串中是否有'/0' B)统计x和y所指字符串中最前面连续相同的字符个数 C)将y所指字符串赋给x所指存储空间 D)统计x和y所指字符串中相同的字符个数
单选题有以下程序
#include <stdio.h>
int fun(int (*s)[4],int n,int k)
{ int m,i;
m=s[0][k];
for(i=1;i<n:i++)
if(s[i][k]>m)
m=s[i][k];
return m;
}
main()
{ int a[4][4]={{1,2,3,4},
{11,12,13,14},
{21,22,23,24},
{31,32,33,34}};
printf("%d/n",fun(a,4,0));
}
程序的运行结果是______。
单选题下列程序(注意: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",