题目内容

下面程序执行后的输出结果是( )。#include char cchar( char ch ){ if ( ch >= 'A' && ch <= 'Z' ) ch = ch - 'A' + 'a'; return(ch);} int main(){ char s[] = "ABC+abc=defDEF", *p = s; while ( *p ) { *p = cchar( *p ); p++; } printf( "%s", s ); return(0);}

A. abc+ABC=DEFdef
B. abc+abc=defdef
C. abcaABCDEFdef
D. abcabcdefdef

查看答案
更多问题

下面程序执行后的输出结果是( )。#include int main(){ char a[10] = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, *p = a + 5; printf( "%d", *--p ); return(0);}

A. 编译错误
B. a[4]的地址
C. 5
D. 3

【提高题】有以下程序:#include #include int main(){ char *p, *q; p = (char *) malloc( sizeof(char) * 20 ); q = p; scanf( "%s%s", p, q ); printf( "%s %s", p, q ); return(0);}程序执行后若从键盘上输入:abc def↙,则输出结果是( )。

A. def def
B. abc def
C. abc d
D. d d

【提高题】有以下定义,则sizeof(a)的值是( )。 (提示:参考 “成员字节对齐”)union U { char st[4]; short i; long l;};struct A { short c; union U u;} a;

A. 6
B. 7
C. 8
D. 9

下面程序执行后的输出结果是()。#include #include struct NODE { int num; struct NODE *next;};int main(){ struct NODE *p, *q, *r; p = (struct NODE *) malloc( sizeof(struct NODE) ); q = (struct NODE *) malloc( sizeof(struct NODE) ); r = (struct NODE *) malloc( sizeof(struct NODE) ); p->num = 10; q->num = 20; r->num = 30; p->next = q; q->next = r; printf( "%d", p->num + q->next->num ); return(0);}

A. 10
B. 20
C. 30
D. 40

答案查题题库