问题:
[单选] 有以下程序 #include <stdio.h>#include <stdlib.h>fun(int *p1,int *p2,int *s){ s=(int*)malloc(sizeof(int));*s=*p1+*p2;free(s);}void main(){ int a=1,b=40,*q=&a;fun(&a,&b,q);printf("%d",*q);}程序运行后的输出结果是
42。0。1。41。
问题:
[单选] 若有定义语句 int b=2; 则表达式(b<<2)/(3||b)的值是
4。8。0。2。
问题:
[单选] 若函数中有定义语句:int a;,则( )。
系统将自动给a赋初值为0。系统将自动给a赋初值一l。这时a中的值无意义。这时a中无任何值。
问题:
[单选] 下列关于单目运算符++,— —的叙述中正确的是( )。
它们的运算对象可以是任何变量和常量。它们的运算对象可以是char型变量和int型变量,但不能是float型变量。它们的运算对象可以是int型变量,但不能是double型变量和float型变量。它们的运算对象可以是char型变量、int型变量和float型变量。
问题:
[单选] 有以下程序 #include <sthio.h> Main() {int s=0,n; For (n=0;n<3;n<0++) {switch(s) { case 0; Case 1;s+=1; Case 2;s+=2;break; Case 3;s+3; Case 4;s+=3 ; } printf((“%dn”,s); } } 程序运行后的结果是
A 1,2,4 。B 1,3,6 。C 3,10,14 。D 3,6,10。
问题:
[单选] fun函数的功能是:通过键盘输入给x所指的整型数组所有元素赋值。在下列划线处应该填写的是( )。#include #define N 5Void fun(int x[N]){int m;For(m=N-1;m>0;m--) scanf(“%d”,____);}A.&x[++m] B.&x[m+1] C.x+(m++) D.x+m
问题:
[单选] 以下选项中有语法错误的是( )。
char *str[ ]={“guest”}; 。char str[10 ]={“guest”};。char *str[3] *str[1]={“guest”}; 。char str[3][10];str[1]={“guest”};。
问题:
[单选] #include void main() { char a[20], b[20], c[20]; scanf("%s%s", a, b); gets(c); printf("%s%s%s", a, b, c); } 程序运行时从第一行开始输入 this is a cat!<回车>,则输出结果是( )。thisisacat! this is a thisis a cat! thisisa cat!
thisisacat! 。this is a 。thisis a cat! 。thisisa cat!。
问题:
[单选] 有以下函数#include void fun(char c){if(c>’x’) fun(c-1);printf (“%c”,c);}main(){fun(”z”);}程序运行输出结果是( )。
xyz 。wxyz 。zyxw 。zyx。
问题:
[单选] 在关系数据库中,用来表示实体间联系的是
二维表 。树状结构 。属性 。网状结构。