网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
for(;;){printf("helloworld/n");}关于本程序段说法正确的是()
A

for语句使用有误,两个分号中间的表达式不能省略

B

这是一个死循环,不停的输出helloworld。

C

这语句还可以简化,省略掉两个分号。

D

/n是一种转义字符,作用是水平制表。


参考答案

参考解析
解析: 暂无解析
更多 “单选题for(;;){printf("helloworld/n");}关于本程序段说法正确的是()A for语句使用有误,两个分号中间的表达式不能省略B 这是一个死循环,不停的输出helloworld。C 这语句还可以简化,省略掉两个分号。D /n是一种转义字符,作用是水平制表。” 相关考题
考题 (33)有以下程序段int i,n;for(i=0;i8;i++){ n=rand()%5;switch (n){ case 1:case 3:printf("%d\n",n); break;case 2:case 4:printf("%d\n",n); continue;case 0:exit(0);}printf("%d\n",n);}以下关于程序段执行情况的叙述,正确的是A)for循环语句固定执行8次B)当产生的随机数n为4时结束循环操作C)当产生的随机数n为1和2时不做任何操作D)当产生的随机数n为0时结束程序运行

考题 有以下程序#include stdio.hmain( ){ 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);

考题 有以下程序段 , 且变量已正确定义和赋值for(s=1.0,k=1;k=n;k++) s=s+1.0/(k*(k+1));printf("s=%f\n\n",s);请填空 , 使下面程序段的功能为完全相同s=1.0;k=1;while( _[10]_______ ){ s=s+1.0/(k*(k+1)); _[11]_______ ;}printf("s=%f\n\n",s);

考题 要求通过 while 循环不断读入字符 , 当读入字母 N 时结束循环 。 若变量已正确定义 , 以下正确的程序段是A)while((ch=getchar())!='N') printf(" % c",ch);B)while(ch=getchar()!='N') printf(" % c",ch);C)while(ch=getchar()=='N') printf(" % c",ch);D)while((ch=getchar())=='N') printf(" % c",ch);

考题 有以下程序段:int i,n;for(i=0;i8;i++) {n=rand( )%5;switch(n){case l:case 3:printf(8;i++){n=rand( )%5;switch(n){case l:case 3:printf(%d\n,n);break;case 2:case 4:print?(%d\n,n);continue;case( ):exit(0);}printf(%d\n,n);}以下关于程序段执行情况的叙述,正确的是( )。A.for循环语句固定执行8次B.当产生的随机数n为4时结束循环操作C.当产生的随机数n为1和2时不做任何操作D.当产生的随机数n为0时结束程序运行

考题 有以下程序 include main() { int n,*p=NULL; *p=n; printf(" 有以下程序 #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);

考题 对于如下C语言程序intmain(){printf(HelloWorld\n);fork();printf(HelloWorld\n);}在UNIX操作系统中正确编译链接后,其正确的运行结果是A.共打印出2行HelloWorldB.共打印出3行HelloWorldC.共打印出4行HelloWorldD.共打印出5行HelloWorld

考题 有以下程序:inlucdemain()D)2 3 3{int n,*P=NULL;*p=printf("input n:");scanf("%d 有以下程序: #inlucde<stdio.h> main()D)2 3 3 {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);

考题 要求通过while循环不断读入字符,当读入字母N时结束循环。若变量已正确定义,下列正确的程序段是( )A.while((ch=getchar ())!='N')printf("%c",ch);B.while(ch=getchar()!='N') printf("%c",ch);C.while(ch=getchar()=='N') printf("%c",ch);D.while((ch=getchar()) =='N')printf('%c',ch);

考题 以下程序段的运行结果是( )。 include main() {int x=2,y=1: switch(x) {case 1: switch 以下程序段的运行结果是( )。 include<stdio.h> main() {int x=2,y=1: switch(x) {case 1: switch(y) {case 0:printf("x=2,y=1\n");break; case 1:printf("y=1\n");break; } case 2:printf("x=2\n"); } }

考题 以下四个程序中,完全正确的是()。A.include main( ); { /* programmlng* / printf( "p 以下四个程序中,完全正确的是( )。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" ); }

考题 有如下程序 main() { int n=9; while(n6){ n-; printf("%d",n); } } 该程序段的输出结果是______。A.987B.876C.8765D.9876

考题 若变量已正确定义,有以下程序段 i=0; do printf("%d,",i;while(i++); Printf("%d\n",,i); 其输出结果是A.0,0B.0,1C.1,1D.程序进入无限循环

考题 有以下程序#include stdio.hmain { 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);

考题 有以下程序段s=1.0;for(k =1;k=n;k++) s=s+1.0/(k*(k=1));printf("%f\n",s);请填空,使以下程序段的功能与上面的程序段完全相同。s=1.0; k=1;while( 【 9 】).{ s=s+1.0/(k*(k+1)); k=k+1;}printf( "%f\n",s);

考题 有以下程序段int i,n;for(i=0;i8;i++){n=rand()%5;switch(n){case 1:case 3:printf(“%d\n”,n);break;case 2.case 4:printf(“%d\n”,n);continue;case 0:exit(0);}printf(“%d\n”,n);}以下关于程序段执行情况的叙述,正确的是A.for循环语句固定执行8次B.当产生的随机数n为4时结束循环操作C.当产生的随机数n为1和2时不做任何操作D.当产生的随机数n为0时结束程序运行

考题 下面程序段的输出为( )。 include "stdio.h" main { printf("%d\n",122); }A.0SXB 下面程序段的输出为( )。 #include "stdio.h" main { printf("%d\n",122); }A.0B.47C.48D.24

考题 有以下程序段: int i,n; for(i=0;i8;i++) {n=rand( )%5; switch(n) {case l: case 3:printf("%d\n",n);break; case 2: case 4:print?("%d\n",n);continue; case( ):exit(0); } printf("%d\n",n); } 以下关于程序段执行情况的叙述,正确的是( )。A.for循环语句固定执行8次B.当产生的随机数n为4时结束循环操作C.当产生的随机数n为1和2时不做任何操作D.当产生的随机数n为0时结束程序运行

考题 下列程序段的输出结果是【】。int n=c; switch(n++) {default:printf(errorc;switch(n++){default:printf(error);break;case a:case A:case b:case B:printf(good);break;case c:caseC:printf(pass);case d:caseD:printf(warn);}

考题 以下正确输出helloworld的是() A.printf("helloworld");B.printf("helloworld")C.print("helloworld");D.print("helloworld")

考题 有如下程序,该程序段的输出结果是( )。voidmain(void){intn=5;while(n>2){n--;printf(“%d”,n);}} A.543B.432C.4321D.5432

考题 若所用变量均已正确定义,则执行下面程序段后的值是() for(i=0 ; i2 ; i++ ) printf("YES"); printf("/n");

考题 for(;;){printf("helloworld/n");}关于本程序段说法正确的是()A、for语句使用有误,两个分号中间的表达式不能省略B、这是一个死循环,不停的输出helloworld。C、这语句还可以简化,省略掉两个分号。D、/n是一种转义字符,作用是水平制表。

考题 若所用变量都已正确定义,请填写以下程序段的输出结果() for(i=1;i=5;i++);       printf("OK/n");

考题 while(10){printf("welcometobaweiUniversity/n");}关于本程序段说法不正确的是()A、while语句是循环结构B、本程序没有增量,因此不能正常停止。C、本程序是个死循环结构D、该程序会输出10句话后停止

考题 单选题while(10){printf("welcometobaweiUniversity/n");}关于本程序段说法不正确的是()A while语句是循环结构B 本程序没有增量,因此不能正常停止。C 本程序是个死循环结构D 该程序会输出10句话后停止

考题 单选题do{printf("Tobeornottobeisaquestion/n");}while(3=3);对于本程序段描述正确的是()A 该程序是一个死循环程序B 输出一遍TobeornottobeisaquestionC do-while是先判断后执行,条件成立继续执行循环体D 该程序不能执行,因为第一次条件就不满足