下列程序输出的结果是( )。#includefunl(chara,charb){charC;c=a;a=b;b=C;)fun2(char*a,charb){charC;c=*a;*a=b;b=c;)fun3(char*a,char*b){charC;C=*a;*a=*b;*b=C;)voidmain( ){chara,b;a='A';b='B';fun1(a,b);putchar(a);putchar(b);a='A';b='B';fun2(&a,b);putchar(a);putchar(b);a='A';b='B';fun3(&a,&b);putchar(a);putchar(b);putchar('\n');}[1分]
举一反三
- 以下程序的输出结果是 #include"stdio.h" sub1(chara,charb){charc;c=a;a=b;b=c;} sub2(char*a,charb){charc;c=*a;*a=b;b=c;} sub3(char*a,char*b){charc;c=*a;*a=*b;*b=c;} main() {chara,b; a='A';b='B';sub3(&a,&b);putchar(a);putchar(b); a='A';b='B';sub2(&a,b);putchar(a);putchar(b); a='A';b='B';sub1(a,b);putchar(a);putchar(b); }
- 下列程序输出的结果是()。 #include<stdio.h> un1(char a,char b){char c;c=a;a=b;b=c;} fun2(char*a,char b){char c;c=*a;*a=b;b=c;} fun3(char*2,char*b){charc;c=*a;*a=*b;*b=c;} void main() { char a,b; a='A';b='B';funl(a,b);putchar(a);putchar(b); A: BABBAB B: ABBBBA C: ABBABA D: ABABBA
- 下列程序输出的结果是( )。 #include<stdio.h> fun1(char a,char b) char c;c=a;a=b;b=c; fun2(char*a,char b) char c;c=*a;*a=b;b=c; fun3(char*a,char*b) char c;c=*a;*a=*b;*b=c; void main() char a,b; a=’A’;b=’B’; fun1 (a,b);putchar( A: ;putchar( B: ; C: a=’
- 读程序写结果。( ) #include“stdio.h” main() { char a,b,c; a=‘B’;b=‘O’; c=‘Y’; putchar(a); putchar(b); putchar(c); putchar(‘’);printf(“”);}
- 下列函数输出表达式不正确的是____。 A: char<br/>n='n';putchar(n); B: putchar('*'); C: char<br/>n='n';float a=1.5;<br/>putchar(a*n); D: putchar('\n');<br/>n='n';float a=1.5;<br/>putchar(a*n);