题目内容

有如下程序#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

有如下程序#include int sum(int* array, int len){if (len == 0)return array[0];elsereturn array[0] + sum(array+1, len-1);}main(){int array[5] = {1,2,3,4,5};int res = sum(array, 4);printf("%d\n", res);}程序运行后的输出结果是

A. 15
B. 10
C. 8
D. 1

答案查题题库