有如下程序#include int change(int* data){return (*data) ++;}main(){int data = 123;change(&data);printf("%d,", data);data = change(&data);printf("%d,", data); printf("\n");}程序运行后的输出结果是
A. 124,124,
B. 123,124,
C. 124,123,
D. 123,123,
查看答案
有如下程序#include void change(int* array, int len){for (; len>=0; len--)array[len] += 2;}main(){int i, array[5] = {1,2};change(array, 4);for (i=0; i<4; i++)printf("%d,", array[i]);printf("\n");}程序运行后的输出结果是
A. 3,4,2,2,
B. 3,4,5,6,
C. 2,3,4,5,
D. 1,2,0,0,
有以下程序#include main(){ char *s="120119110";int n0,n1,n2,nn,i;n0=n1=n2=nn=i=0;do{switch(s[i++]){ default : nn++;case '0' : n0++;case '1' : n1++;case '2' : n2++;}} while(s[i]);printf("n0=%d,n1=%d,n2=%d,nn=%d\n",n0,n1,n2,nn);}程序的运行结果是
A. n0=3,n1=8,n2=9,nn=1
B. n0=2,n1=5,n2=1,nn=1
C. n0=2,n1=7,n2=10,nn=1
D. n0=4,n1=8,n2=9,nn=1
有如下程序#include main(){char* p1 = 0;int* p2 = 0;double* p3 = 0;printf("%d,%d,%d\n", sizeof(p1), sizeof(p2), sizeof(p3));}程序运行后的输出结果是
A. 4,4,4
B. 1,4,8
C. 0,0,0
D. 1,2,4
有如下程序#include main(){int a = 0, *ptr;ptr = &a;*ptr = 3;a = (*ptr) ++;printf("%d,%d\n", a, *ptr);}程序运行后的输出结果是
A. 4,4
B. 0,1
C. 1,4
D. 0,4