What does the following function return?
char foo(void)
{
unsigned int a = 6;
iht b = -20;
char c;
(a+b > 6) ? (c=1): (c=0);
return c;
}
第1题:
以下程序的输出结果是 int a[3][3]={1,2,3,4,5,6,7,8,9,},*p; int main(void) { p=(int*)malloc(sizeof(int)); f(p,a); printf("%d n",*p); return 0; } f(int *s, int p[][3]) { *s=p[1][1]; }
A.1
B.4
C.7
D.5
第2题:
在C程序中,设一表达式中包含有int,long, unsigned和char类型的变量和数据,则表达式最后的运算结果类型是()。
A.long
B.int
C.char
D.unsigned
第3题:
8位AVR处理器ATmega1281上int型为2字节,char型为1字节,则下述程序运行时态SRAM中DATA区大小为多少个字节? int a = 68, b = 70, c = 79; char k[6] = {1, 2, 3, 4, 5, 6}; int main (void) { int d; k[2] = 20; d = fun(a, b); return (d+k[2]); }
A.12
B.24
C.6
D.9
第4题:
针对以下的函数,那个函数调用不正确? def foo(arg1, arg2='test', arg3=100): print arg1, arg2, arg3
A.foo('where')
B.foo(arg2 = 'what', 10)
C.foo(arg1 = 'where', arg2 = 'what')
D.foo('where','what')
第5题:
【单选题】下列程序的运行结果是 void fun(int *a, int *b) { int *k; k=a; a=b; b=k; } int main(void) { int a=3, b=6, *x=&a, *y=&b; fun(x,y); printf("%d %d", a, b); return 0; }
A.6 3
B.3 6
C.编译出错
D.0 0
第6题:
针对以下的函数,正确的函数调用有哪些? def foo(arg1, arg2='test', arg3=100): print arg1, arg2, arg3
A.foo('where','what')
B.foo('where')
C.foo(arg1 = 'where', arg2 = 'what')
D.foo(arg2 = 'what', 10)
E.foo(arg = 'where')