以下程序的输出结果是【 】。
include<iostream. h>
viod main() {
char sl[5]= "ABCD", s2=[5];
int k;
for(k=0;k<4:k++)
s2[k]=(sl[k]- '0' +1) + '0' ;
s2[k]= '\0' ;
cout<<s2;
第1题:
以下程序段的输出结果是 ______。 #include<iostream.h> void main(){ char*p[5]={"ABCD","EF","GHI","JKL","MNOP"}; char **q=p; int i; for(i=0;i<=4;i++) cout<<q[i]; }
A.ABCDEFGHIJKL
B.ABCD
C.ABCDEFGHIJKMNOP
D.AEGJM
第2题:
以下程序的输出结果是( )。 #include <stdio.h> int fan(int); main() { int w=5; fun(w); printf("\n"); } fun(int k) { if(k>0) fun(k-1); printf("%d",k); }
A.5 4 3 2 1
B.0 1 2 3 4 5
C.1 2 3 4 5
D.5 4 3 2 1 0
第3题:
以下程序的输出结果是( )。 include<stdio.h> void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main() {int i=3,j=5,*p=&i,*q=&j; swap(p,q);printf("%d %d\n",*p,*q); }
第4题:
以下程序的输出结果是_______。 #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++: *sl=*s2-; *s2=t; } } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }
A.1234567
B.7654321
C.1711717
D.7177171
第5题:
以下程序的输出结果是( )。
include<stdlib.h>
main()
{char*s1,*s2,m;
s1=s2=(char*)malloc(sizeof(char));
*s1=15;
*s2=20;
m=*s1+*s2:
printf("%d\n",m);
}