3,3,3
2,2,3
1,2,3
1,1,3
第1题:
以下四个程序中,完全正确的是( )。
A.#include <stdio.h> main( ); { /* programmlng* / printf( "programming! \n" ); }
B.#include <stdio.h> main( ) { /*/programming printf("programming! \n"); }
C.#include <stdio.h> main( ) { /*programming* / printf( "programming! \n" ); }
D.include <stdio.h> main ( ) { /*/* programming*/*/ printf( "programming! \n" ); }
第2题:
有以下程序: #include <stdio.h> main ( ) int i; for(i =0;i <3 ;i ++ ) switch (i) case 0: printf(" % d" ,i); case 2: printf(" % d" , i); default: printf( "% d" , i);程序运行后的输出结果是( )。
A.22111
B.21021
C.122
D.12
第3题:
有以下程序 #include <stdio.h> main() { int y=9; for( ; y>0; y--) if(y%3==0) printf("%d",--y); } 程序的运行结果是
A.741
B.963
C.852
D.875421
第4题:
有以下程序 #include <stdio.h> main() { int a=1, b=2, c=3, x; x=(a^b)&c; printf("%d\n",x); } 程序的运行结果是
A.0
B.1
C.2
D.3
第5题:
以下程序的执行结果是【 】。
include <iostream.h>
include <fstream.h>
include <stdlib.h>
int main()
{
fstream outfile, infile;
outfile.open("D:\\text.dat",ios::out);
if(!outfile)
{
cout<<"text.dat can't open"<<end1
第6题:
有以下程序:#include <stdio.h>main( ){ int a=1,b; for(b =1;b <=10;b++) { if(a> =8) break; if(a%2 == 1) {a + =5;continue;} a- =3; printf( "% d \n" ,b);}程序运行后的输出结果( )。
A.3
B.4
C.5
D.6
第7题:
以下程序的输出结果是#include "stdio.h"main(){ int a=065; printf("%d\n",--a);}
第8题:
下面程序的运行结果是( )。
include<stdio.h>
main()
{int a=25;
fun(&A);
}
fun(int *x)
{ printf("%d\n",++*x);
}
第9题:
有以下程序 #include <stdio.h> int fun(int a, int b) { if(b==0) return a; else return(fun(-a,-b)); } main() { printf("%d\n",fun(4,2)); } 程序的运行结果是______。
A.1
B.2
C.3
D.4
第10题:
以下4个程序中,完全正确的是
A.#include <stdio.h> main(); {/*programming*/ printf("programming!\n");}
B.#include <stdio.h> main(); {/*/ programming /*/ printf("programming!\n");}
C.#include <stdio.h> main() {/*/*programming*/*/ printf("programming!\n");}
D.include <stdio.h> main() {/*programming*/ printf("programming!\n");}
第11题:
若有以下程序
#include <stdio.h>
int a[ ]={2,4,6,8};
main( )
{ int i;
int *p=a;
for(i=0;i<4;i++) a[i]=*p;
printf("%d\n",a[2]);}
上面程序的输出结果是
A.6
B.8
C.4
D.2
第12题:
以下程序的输出结果是( )。 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); }
第13题:
以下程序运行后的输出结果是【 】
include <stdio.h>
main ( )
{ char a[] ="123456789", *p;
int i =0;
p=a;
while( * p)
{ if(i%2 ==0) *p='*';
p++;i++;
}
puts(a);
}
第14题:
有以下程序
#include <stdio.h>
#define F(X,Y) (X)*(Y)
main( )
{ int a=3, b=4;
printf("%d\n", F(a++, b++));
}
程序运行后的输出结果是
A.12
B.15
C.16
D.20
第15题:
有以下程序 #include <stdio.h> int a=1; int f(int c) { static int a=2; c=c+1; return (a++) + c; } main() { int i, k=0; for(i=0;i<2;i++) { int a=3; k += f(a); k +=a; printf("%d\n",k); }
A.14
B.15
C.16
D.17
第16题:
请将以下程序中的函数声明语补充完整。
include<stdio.h>
int【 】
main()
{ int x,y,(*p)();
sccanf("%d%d",&x,&y);
p=max;
printf(%d\n",(*p)(x,y));
}
int max(int a,int b)
{return(a>b?a:b);}
第17题:
有以下程序:#include <stdio.h>#include <string.h>main( ) { char a[ 7 ] = "a0 \0a0 \0"; int i,j; i = sizeof(a); j = strlen(a); printf(" % d %d \n" ,i,j); }程序运行后的输出结果是( )。
A.22
B.76
C.72
D.62
第18题:
以下程序的输出结果是( )。 #include <stdio.h> main() { int i; for(i=1;i<5;i++) { if(i%2) printf("*"); else continue; printf("#"); } printf("$\n");
A.*#*#*#$
B.#*#*#*$
C.*#*#$
D.#*#*$
第19题:
以下程序运行后的输出结果是( )。
include<stdio.h>
main()
{ int x=20;
printf("%d", 0<x<20);
printf("%d\n", 0<x && x<20);
}
第20题:
以下程序的输出结果是【 】。
include<stdio.h>
main()
{ struct stru
{ int a;
float b;
char d[4];
};
printf("%d\n",sizeof(struct stru));
}
第21题:
有以下程序 #include <stdio.h> #include <stdlib.h> int fun(int n) {int *p; p=(int*)malloc(sizeof(int)); *p=n; return *p; } { int a; a=fun(10); printf("%d\n",a+fun(10)); } 程序的运行结果是______。
A.0
B.10
C.20
D.出错
第22题:
以下四个程序中,完全正确的是______。
A.#include <stdio.h> main(); {/*programming*/ printf("programming!\n");}
B.#inc lude<stdio.h> main() {/*/programming/*/ printf("programming!\n");}
C.#include <stdio.h> main() {/*programming*/ printf("programming!\n");}
D.include<stdio.h> main() {/*/*programming*/*/ printf("programming!\n");}
第23题:
有以下程序: #include <stdio.h> main( ) { int a,b,d =25; a = d/10%9;b = a&&(-1); printf("% d,% d\n" ,a,b); } 程序运行后的输出结果是( )。
A.6,1
B.2,1
C.6,0
D.2,0
第24题:
以下程序的输出结果为() #include "stdio.h" main( ){int a=010,j=10;printf("%d,%d/n",++a,j--);}