若有以下程序段,输出结果是( )。
char s[ ]="\\141\141abc\t";
printf ("%d\n",strlen(s));
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346521.html
点击查看答案
有以下程序
void fun2(char a, char b){printf(“%c%c”,a,b);}
char a= 'A',b= 'B';
void fun1( ){ a= 'C'; b= 'D'; }
main( )
{ fun1( ) ;
printf( “%c%c”,a,b);fun2('E', 'F'); }
程序的运行结果是()。
A. CDEF
B. ABEF
C. ABCD
D. CDAB
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346505.html
点击查看答案
C语言中,数组名代表()。
A. 数组全部元素的值
B. 数组首地址
C. 数组第一个元素的值
D. 数组元素的个数
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346503.html
点击查看答案
有以下程序
#include
main()
{ char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′};
printf("%d%d\n",strlen(p),strlen(q));}
以下叙述中正确的是 ( )。
A. 在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3
B. 由于p数组中没有字符串结束符,长度不能确定,但q数组中字符串长度为3
C. 由于q数组中没有字符串结束符,长度不能确定,但p数组中字符串长度为3
D. 由于p和q数组中都没有字符串结束符,故长度都不能确定
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346523.html
点击查看答案
假定int类型变量占用两个字节,其有定义:int x[10]={0,2,4};,则数组x在内存中所占字节数是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346514.html
点击查看答案
以下程序的输出结果是()。
main()
{ int a=4,b=5,c=0,d;
d=!a&&!b||!c;
printf("%d\n",d);}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e034650b.html
点击查看答案
有以下程序
#include
int fun (int x,int y)
{ if (x!=y) return ((x+y)/2);
else return (x);
}
main()
{ int a=4,b=5,c=6;
printf("%d\n",fun(2*a,fun(b,c)));
}
程序运行后的输出结果是 ()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346523.html
点击查看答案
#include
void disp(char *string)
{
if(*string)
{
disp( string+1);
putchar (*string);
}
}
void main()
{
disp("abcdefg");
}
程序的运行结果是( )。
A. abcdefg
B. gfedcba
C. abcd
D. dcba
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346506.html
点击查看答案
有以下程序
main()
{int a=1,b=3,c=5;
int *p1=&a,*p2=&b,*p=&c;
*p=*p1*(*p2);
printf("%d\n",c);
}
执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346500.html
点击查看答案
设有如下定义:
int (*ptr)();
则以下叙述中正确的是()。
A. ptr是指向一维组数的指针变量
B. ptr是指向int型数据的指针变量
C. ptr是指向函数的指针,该函数返回一个int型数据
D. ptr是一个函数名,该函数的返回值是指向int型数据的指针
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346510.html
点击查看答案