写出程序的运行结果。 main( ) { int a=0; for ( a=0;a<3;a++ ); printf ( " %d\n", a ); } 输出结果是()。
阅读程序写出结果:#include int fun(double a,double b);void main( ){ cout<
阅读程序写出结果#include int add(int x,int y=8);void main( ){ int a=4;cout<
阅读下列程序,写出运行结果 ________ 。 #include struct ty{ int data;charc;}; fun(struct ty b) { b.data =200; b.c='y'; } int main() { struct ty a={100,'x'}; fun(a); printf(\%d,%c\\n\,a.data,a.c); return 0; }
写出以下程序的运行结果( )。 #include \stdio.h\ void sub( int *x, int y, int z) { *x=y-z; } int main() { int a,b,c; sub(&a,10,5); sub(&b,a,7); sub(&c,a,b); printf(\%d,%d,%d\\n\,a,b,c); return 0; }
下面程序的运行结果是( )。#include void fun(int a,int *b){a=4;*b=2*a;}int main(){int a=5,b=2;fun(a,&b);printf(\%d\\n%d\\n\,a,b);return 0;}
写出下列程序的运行结果_________。int x=1;void fun(int y){int x=5;x+=y++;printf(“%d”,x);}int main(){int a=3;fun(a);x+=a++;printf(“%d”,x);}
下面程序运行时,如果输入:123456,则输出结果是____。#includevoid main(){ int a,b;scanf('%2d%3d',&a,&b);printf('a=%d b=%d ',a,b);}
下面程序的运行结果是( )。 #include int main() { int a,s,n,count;a=2;s=0;n=1;count=1; while(count<=7) { n=n*a;s=s+n;++count; } printf(“%d”,s); return 0; }
04410012:写出下面程序输出结果( )。int main( ){int x=1, y=0, a=0, b=0;switch(x){case 1: switch(y){ case 0: a++;case 1: b++;}case 2: a++; b++;}printf(\a=%d, b=%d \, a, b) ;}
下面程序的运行结果为include<iostream.h>void swap(int &a, int b){int temp;temp=a++;a=b;b=temp;}void main()int a=2,b=3;swap(a, b) ;cout < < a < <"," < < b < < endl;}
读下面的:includevoid main(){static int a[]={1,2,3,4,5};int *p=a;printf();printf();}写出运行的结果、
下面程序的运行结果是__。include< stdio.h >main(){ int a[5],i; for(i=0;i< 5;i++) { a=9(i-2+4(i >3))%5; printf(“%2d”,a); } }
下面程序的运行结果为()。 include<iostream.h> void swap(int &a,int B) { int temp; temp=a++; a=b; b=temp; } void main() { int a=2,b=3; swap(a,b); cout<<a<<“,”<<b<<end1; }
下面程序的运行结果是include"iostream.h"define sum(a,b)a*bvoid main(){int x;X=sum(1+2,3);
下面程序的运行结果为 include<iostream.h> void main() { for(int a=0,x=0;! x&&a<=10;a++) { a++; } cout<<a<<end1; }
下面程序的运行结果是__。include< stdio.h >main(){ int a[3][3]={1,2,3,4,5,6,7,8,9},i; for(i=0;i<=2;i++) printf(“%d “,a[2-i]); }
写出程序的运行结果的第二行输出: 。 include <stdio.h> int main() { int X[4][4]={{11,2
写出下面程序的输出结果includeint main(){int x=1, y=0, a=0, b=0;switch(x){case 1:switch(y){case 0: a++;case 1: b++;}case 2: a++;b++;}printf(“a=%d, b=%d
下面程序的运行结果是().includeusing namespace std;int main(){ float a=1,b=2,c; float p1=&a,p2; p2=&b; c= * p1 + p2; cout<<p1<<”;}
下面程序的运行结果是:main(){ int i,j,a=0; for (i=0;i<2;i++) { for (j=0;j<=4;j++) { if(j%2) break; a++; } a++; } printf(“%d”,a);}
写出下面程序执行后的运行结果。 include <stdio.h> include <math.h> define ROUND(x,m) ((int)((x)*pow(10,m)+0.5)/pow(10,m)) int main() { printf("%f,%f", ROUND(12.3456,1),ROUND(12.3456,2)); return 0; }
下面程序运行后输出的结果为: include int main(); return 0; }
写出下面程序执行后的运行结果。 include <stdio.h> struct { int a,b; union {int M,N;char ch[10];} in; } Q,*p=&Q; int main() { Q.a=3;Q.b=6; Q.in.M=(*p).a+(*p).b;Q.in.N=p->a*p->b; printf("%d,%d,%d",sizeof(Q.in),Q.in.M,Q.in.N); return 0; }