(25)有以下程序(说明:字母A的ASCII码值是65)
#include <stdio.h>
void fun(char *s)
{ while(*s)
{ if(*s%2) printf("%c",*s);
s++;
}
}
main()
{ char a[]="BYTE";
fun(a); printf("\n");
}
程序运行后的输出结果是
A)BY
B)BT
C)YT
D) YE
第1题:
(21)有以下程序
#include<stdio.h>
main()
{char *s=(“ABC);
do
{printf(“%d”,*s%10);s++;
}while(*s);
}
注意,字母A的ASCII码值为65。程序运行后的输出结果是
A)5670 B)656667 C)567 D)ABC
第2题:
有以下程序: #include<stdio.h> void fun(char**p) { ++P;printf("%s\n",*p);} main() char*a[]={"Morning","Afternoon","Evening","Night"}; fun(A); } 程序的运行结果是( )。
A.Afternoon
B.fternoon
C.Morning
D.oring
第3题:
有以下程序
#include <stdio.h>
void fun(char *a,char *b)
{ while(*a=='*') a++;
while(*b=*a) {b++;a++;}
}
main( )
{ char *s="****a*b****",t[80];
fun(s,t); puts(t);
}
程序的运行结果是
A)*****a*b
B) a*b
C) a*b****
D) ab
第4题:
有以下程序: #include<stdio.h> void fun(char *a,char*B){while(*a=='*')a++; while(*b=*A){b++;a++;} } main() {char*s="****a*b****",t[80]; fun(s,t);puts(t); } 程序的运行结果是( )。
A.*****a*b
B.a*b
C.a*b****
D.ab
第5题:
有以下程序 #include <stdio.h> void fun(char **p) { ++p; printf("%s\n",*p); } main() { char *a[]={"Moming","Afternoon","Evening","Night"}; fun(a); } 程序的运行结果是
A.Afternoon
B.fternoon
C.Morning
D.orning
第6题:
(25)有以下程序
#include<stdio.h>
void fun(char *s)
{while(*s)
{ if(*s%2==0) printf(“%c”,*s);
s++;
}
}
main()
{ char a[]={“good”};
fun(a);printf(“\n”);
}
注意:字母a的ASCII码值为97,程序运行后的输出结果是
A)d B)go C)god D)good
第7题:
有以下程序: #include <stdio.h>void funl (char * p){ char * q; q=p; while( *q! ='\0') } (*q) ++;q++;}mains( ){ char a[ ] = { "Program" } , * p; p = &a[3]; fun1 (p); printf("% s \n" ,a);}程序执行后的输出结果是( )。
A.Prohsbn
B.Prphsbn
C.Progsbn
D.Program
第8题:
有以下程序
#include <stdio.h>
main()
{ char *s={"ABC"};
do
{ printf("%d",*s%10);s++;
}
while (*s);
}
注意 : 字母 A 的 ASCII 码值为 65 。程序运行后的输出结果是
A)5670
B)656667
C)567
D)ABC
第9题:
有以下程序 #include <stdio.h> void fun(char *t, char *s) { while(*t!=0) t++; while( (*t++ = *s++ )!=0 ); main() { char ss[10]="acc",aa[10]="bbxxyy"; fun(ss, aa); printff"%s,%s\n", ss,aa); 程序的运行结果是
A.accxyy, bbxxyy
B.acc, bbxxyy
C.accxxyy, bbxxyy
D.accbbxxyy, bbxxyy
第10题:
有以下程序 #inc1ude<stdio.h> main() { char*s={"ABC"}; do { printf("%d",*s%10); s++; } while(*s); } 注意字母A的ASCII码值为65。程序运行后的输出结果是______。
A.5670
B.656667
C.567
D.ABC