下面程序的运行结果是【 】。
include<iostream.h>
void main()
{
char s[]="9876",*p;
for(p=s;p<s+2;p++)
cout<<p;
}
第1题:
以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }
A.3
B.6
C.8
D.0
第2题:
以下程序运行后,输出结果是( ) #include<stdio.h> ss(char *s) { char*p=s; while(*p) p++ return(p-s); } main() { char *a="abded" int i; i=ss(a) ; printf("%d\n",i); }
A.8
B.7
C.6
D.5
第3题:
若有以下定义语句,程序运行后的输出的结果是______。 char s[]="9876",*p; for (p=s;p<s+2;p++) cout<<p<<endl;
第4题:
以下程序运行后的输出结果是【 】。
include<iostream.h>
void main(){
char s[]=“123456”,*p;
for(p=s; p<s+2; p++)
cout<<p<<end1;
}
第5题:
下面程序的运行结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) {t=*s1++;*s1=*s2--;*s2=t;} } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }
A.7654321
B.1714171
C.1711717
D.7177171