以下程序段的输出是() floata=57.666; printf(“*%010.2f*/n”,a);
第1题:
以下程序段的输出结果是
int a=1234;
printf("%2d\n",a);
A.12
B.34
C.1234
D.提示出错、无结果
第2题:
设已执行预编译命令#include<string.h>,以下程序段的输出结果是 char s[]=" an apple" ; printf("%d\n",strlen(s));
A.7
B.8
C.9
D.10
第3题:
A.12
B. 12.3
C. 12.8
D. 12.3
第4题:
有以下程序
#include <stdio.h>
main( )
{ printf("%d\n",NULL); }
程序运行后的输出结果是
A.0
B.1
C.-1
D.NULL没定义,出错
第5题:
有以下程序: #include<stdio.h> main() { printf("%d\n",NULL);} 程序运行后的输出结果是( )。
A.0
B.1
C.-1
D.NULL没定义,出错
第6题:
以下程序段的输出结果是______。 int a=1234; printf("%2d\n",a);
A.12
B.34
C.1234
D.提示出错
第7题:
以下程序的输出结果是( )。 main { int a=3: printf("%d\n",(a+a-=a*a)); }
A.-6
B.12
C.0
D.-12
第8题:
有以下程序
#include <stdio.h>
void func(int n)
{ int i;
for(i=0;i<=n;i++) printf(”*”);
printf(”#”).
}
main( )
{ func(3); printf(”???? ”); func(4); printf(”\n”); }
程序运行后的输出结果是
A)****#????***#
B)***# ????*** *#
C)**#????*****#
D)****#????*****#
第9题:
以下程序的输出结果是( )。 char str[15]=”hello!”; printf(“%d\n”,strlen(str));
A.15
B.14
C.7
D.6
第10题:
下列程序段的输出结果是【】。
int n="c";
switch(n++)
{default:printf("error");break;
case "a":
case "A":
case "b":
case "B":printf("good");break;
case "c":case"C":printf("pass");
case "d":case"D":printf("warn");
}
n++是在执行完其所在的语句后再加1,因此,在执行case的时候,n的值依然为'c',执行case'c'后面的语句,先打印出“pass”;在执行完case'c'后,未遇到break跳出switch,便接着执行下面的语句,又打印出warn。所以此题输出结果是passwarn。
第11题:
以下程序段的输出结果是()。 Char s[]I=”/1238/080abc”; printf(”%d/n”,strlen(s));
第12题:
第13题:
有以下程序 #include <stdio.h> main() { int n,*p=NULL; *p=&n; printf("Input n:");scanf("%d",&p);printf("output n:");printf("%d\n",p); } 该程序试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是
A.int n,*p=NULL;
B.*p=&n;
C.scanf("%d",&p)
D.printf("%d\n",p);
第14题:
以下程序的输出结果是( )。
int a=1234;
printf ("-\n",a);
第15题:
有如下程序 main() { int n=9; while(n>6){ n-; printf("%d",n); } } 该程序段的输出结果是______。
A.987
B.876
C.8765
D.9876
第16题:
以下程序段的输出结果是 char s[]="\\141\141abc\t"; printf ("%d\n",strlen(s));
A.9
B.12
C.13
D.14
第17题:
有以下程序 #include<stdio.h> main() {printf("%d\n",NULL);} 程序运行后的输出结果是
A.0
B.1
C.-1
D.NULL没定义,出错
第18题:
有以下程序#include <stdio.h>main { int n,*p=NULL; *p=&n; printf("Input n:"); scanf("%d",&p); printf("output n:"); printf("%d\n",p);}该程序试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是A.int n,*p=NULL; B.*p=&n; C.scanf("%d",&p) D.printf("%d\n",p);
第19题:
以下程序的输出结果是( )。 #include <stdio.h> main() { int n=4; while(n--) printf("%d ",--n); }
A.2 0
B.3 1
C.3 2 1
D.2 1 0
第20题:
有以下程序: #include <stdio.h>main( ){ int m =12,n=34; printf( "% d% d" ,m++ , ++n); printf("% d% d \n" ,n ++ , ++m); }程序运行后的输出结果是( )。
A.12353514
B.12353513
C.12343514
D.12343513
第21题:
下面程序段的输出为( )。 #include "stdio.h" main { printf("%d\n",12<<2); }
A.0
B.47
C.48
D.24
第22题:
设已执行预编译命令#include<string.h>,以下程序段的输出结果是( )。 char s[]=" an apple" ; printf(" %d\n" ,strlen(s));
A.7
B.8
C.9
D.10
第23题:
若有以下程序段:charstr[]=”ab/n/012///””;printf(“%d”,strlen(str));该程序段的输出结果是()