题目内容

请阅读下面的程序,写出程序执行后的输出。#include int main(){int array[10]={1,2,3,4,5,6,7,8,9,10};int *p=&array[2];printf("%d\n",*p);p=p+5;printf("%d\n",*p);p++;printf("%d\n",*p);p=p-2;printf("%d\n",*p);if(*p

查看答案
更多问题

读下列程序,写出程序的输出结果。#include void main(){ char str[ ]=”abcdef”,*p=str;int i;for ( i=0; i<4 ; i++, p++ )puts(p);}输出结果为:

运行以下程序,若输入:5 7<回车>时,写出程序的输出结果。#includevoid fun1(int *p1, int *p2){ int t;t=*p1; *p1=*p2; *p2=t;}void fun2(int x,int y){ int t;t=x; x=y; y=t;}void main(){ int x,y;int *p1,*p2;scanf("%d%d",&x,&y);p1=&x;p2=&y;if(xy) fun2(x,y);printf("x=%d,y=%d",x,y);}输出结果为:

读下列程序,写出程序的输出结果。#includeint main(){ int x[8]= {1, 2, 3, 4, 5, 6, 7, 8 };int *p=x;for (;p

读下列程序,写出程序的输出结果。#include void sub (int *a, int n, int k){ if (k<=n) sub(a,n/2,2*k);*a+=k;}void main (){ int x=0;sub (&x,8,1);printf (“x=%d\n”,x);} 输出结果为:

答案查题题库