有以下程序
struct stu
{ int num;
char name[10];
int age;
};
void fun(struct stu *p)
{ printf("%s\n",(*p).name); }
main()
{
struct stu students[3]={{9801,"Zhang",20},
{9802,"Wang",19},
{9803,"Zhao",18} };
fun(students+2);
}
输出结果是()。
A. Zhang
B. Zhao
C. Wang
D. 18
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346505.html
点击查看答案
有以下程序
main()
{char c1,c2,c3,c4,c5,c6;
scanf("%c%c%c%c",&c1,&c2,&c3,&c4);
c5=getchar(); c6=getchar();
putchar(c1);putchar(c2);
printf("%c%c\n",c5,c6);
}
程序运行后,若从键盘输入(从第1列开始)
123<回车>
45678<回车>
则输出结果是()。
A. 1267
B. 1256
C. 1278
D. 1245
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650f.html
点击查看答案
下列程序的输出结果是()。
main()
{ double d=3.2; int x,y;
x=1.2; y=(x+3.8)/5.0;
printf("%d \n", d*y);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346507.html
点击查看答案
假定int类型变量占用两个字节,其有定义:int x[10]={0,2,4};,则数组x在内存中所占字节数是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346514.html
点击查看答案
有以下程序
#include
void fun(int *x,int i)
{*x=*(x+i);}
void main()
{ int a[8]={1, 2, 3, 4, 5, 6, 7, 8},i;
fun(a,2);
for(i=0; i<8/2; i++)
{ printf("%d",a[i]);}
printf("\n");
}
执行后的输出结果是( )。
A. 3234
B. 3231
C. 2334
D. 2331
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346515.html
点击查看答案
C语言中最简单的数据类型包括()。
A. 整型、实型、逻辑型
B. 整型、实型、字符型
C. 整型、字符型、逻辑型
D. 整型、实型、逻辑型、字符型
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346503.html
点击查看答案
有以下程序
#include
main()
{ int x=1,y=0;
if(!x) y++;
else if(x==0)
if (x) y+=2;
else y+=3;
printf("%d\n",y);
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651f.html
点击查看答案
有语句char str1[10],str2[10]={"china"};则能将字符串china赋给数组str1的正确语句是( )。
A. str1={"china"};
B. strcpy(str1,str2);
C. str1=str2;
D. strcpy(str2,str1);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034651d.html
点击查看答案
有如下程序
main()
{ char ch[2][5]={"6937","8254"},*p[2];
int i,j,s=0;
for(i=0;i<2;i++)p[i]=ch[i];
for(i=0;i<2;i++)
for(j=0;p[i][j]>'\0';j+=2)
s=10*s+p[i][j]-'0';
printf("%d\n",s);}
该程序的输出结果是()。
A. 69825
B. 63825
C. 6385
D. 693825
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650c.html
点击查看答案
定义struct st
{int x;
float y;
double z;
} b;
则b是字节数 。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346511.html
点击查看答案