更多"下列程序输出的结果是( )。 #include<stdio.h> "的相关试题:
[单项选择]下列程序输出的结果是( )。
#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. ;
[单项选择]下列程序输出的结果是( )。 #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); a=’A’;b=’B’; fun2 (&a,b);putchar(a);putchar(b); a=’A’;b=’B’; fun3 (&a,&b);putchar(a);putchar(b); putchar(’/n’); }
A. BABBAB
B. ABBBBA
C. ABBABA
D. ABABBA
[单项选择]以下程序的输出结果是
char cchar(char ch)
if(ch>=’A’&&ch<=’Z’) ch=ch-’A’+’a’;
return ch;
main ( )
char s [] = "ABC+abc=defDEF" , *p=s;
while (*p)
*p=cchar(*p);
p++;
printf "%$/n", s);
A. abc+ABC=DEFdef
B. abc+abc=defdef
C. abcABCDEFdef
D. abcabcdefdef
[单项选择]以下程序的输出结果是______。
char cchar(char ch)
if(ch>=’A’&&ch<=’z’)ch=ch-’A’+’a’;
return ch;
main( )
char s[]="ABC+abc=defDEF",*p=s;
while(* p)
* p=cchar(* p);
p++;
printf("% s/n", s);
A. abe+ABC=DEFdef
B. abc+abe=defdef
C. abcaABCDEFdef
D. abcabcdefdef
[填空题]阅读下面程序:
#include<iostream.h>
void fun1(char a,char b)
char c;
c=a;a=b;b=c;
void fun2(char &a,char &b)
char c;
c=a;a=b;b=c;
void main( )
char a,b;
a=’x’;b=’y’;
fun1(a,b);cout<<a<<b;
a=’x’;b=’y’;
fun2(a,b);cout<<a<<b;
则该程序的输出为______。
[单项选择]以下程序的输出结果是
chsr cchar(char ch)
if(ch>=’A’&&ch<=’Z’)ch=ch-’A’+’a’;
return ch;
main( )
char s[]=“ABC+abc=defDEF”,*p=s;
while(*p)
*p=cchar(*p);
p++;
printf(“%s/n”,s);
A. abd+ABC=DEFdef
B. abc+abc=defdef
C. abcABCDEFdef
D. abcabcdefdef
[单项选择]下列程序输出的结果是( )。
#include<stdio.h>
funl(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);
a=’A’;b=’B’;fun2(&a,b);putchar(a);putchar(b);
a=’A’;b=’B’;fun3(&a,&b);putchar(a);putchar(b);
putchar(’/n’);
A. BABBAB
B. ABBBBA
C. ABBABA
D. ABABBA
[单项选择]下列程序输出的结果是( )。
#include<stdio.h>
subl(char a,char b) char c;c=a;a=b;b=c;
sub2(char*a,char b) char c;c=*a;*a=b;b=c;
sub3(char*a,char*b) char c;c=*a;*a=*b;*b=c;
void main( )
char a,b;
a=’A’;b=’B’;subl(a,b);putchar(a);putchar(b);
a=’A’;b=’B’;sub2(&a,b);putchar(a);putchar(b);
a=’A’;b=’B’;sub3(&a,&b);putchar(a);putchar(b);
putchar(’/n’);
A. BABBAB
B. ABBBBA
C. ABBABA
D. ABABBA
[单项选择]下列程序输出的结果是( )。
#include<stdio.h>
sub1(char a,char b) char c;c=a;a=b;b=c:
sub2(char*a,charb) charc;c=*a;”a=b:b=c;
sub3(char*a,char*b) char c;c=*a;”a=*b;*b=c:
void main( )
char a,b;
a=’A’;b=’B’;sub1(a,b);putchar(a);putchar(b);
a=’A’;b=’B’;sub2(&a,b);putchar(a);putchar(b);
a=’A’;b=’B’;sub3(&a,&b);putchar(a);putchar(b):
putchar(’/n’);
A. ABABAB
B. ABBBBA
C. ABBABA
D. ABABBA