有如下程序#include main(){int i, *ptr;int array[3] = {8,2,4};for (ptr=array, i=0; i<2; i++)printf("%d,", *ptr++);printf("\n");}程序运行后的输出结果是
A. 8,2,
B. 8,8,
C. 2,4,
D. 4,8,
查看答案
有如下程序#include main(){int i, *ptr;int array[5] = {5,3,1};for (ptr=array, i=0; i<5; i++, ptr++){if (*ptr == 0)putchar('X');elseputchar('A' + *ptr);}printf("\n");}程序运行后的输出结果是
A. FDBXX
B. FFFXX
C. FDBBB
D. ABCDE
有如下程序#include #include main(){char name[10] = "c-book";char* str = name;printf("%d,%d,%d,%d\n", sizeof(name), strlen(name), sizeof(str), strlen(str));}程序运行后的输出结果是
A. 10,6,4,6
B. 11,6,11,6
C. 11,6,1,6
D. 10,7,1,7
有如下程序#include int disp(char* str){while (*str) putchar(*str++);return *str;}main(){printf("%d\n", disp("NAME"));}程序运行后的输出结果是
A. NAME0
B. NAMEE
C. NAME
D. NAME\0
有如下程序#include main(){char *p, old_str[10] = "wind";int password;scanf("%d", &password);p = old_str;while (*p){printf("%c", *p + password);p++;}printf("\n");}程序运行时,从键盘输入2<回车>,输出结果是
A. ykpf
B. wind
C. xjoe
D. 2222