若输入字符串:abcde↙,则以下while循环体将执行次。while((ch=getchar())==’e’)printf("*");
第1题:
要求通过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):
第2题:
要求通过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);
第3题:
当执行以下程序时,输入 1234567890< 回车 > ,则其中while循环中的printf("#")将执行___次. #include <stdio.h> int main() { char ch; while((ch=getchar())=='0') printf("#"); return 0; }
第4题:
要求通过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);
第5题:
要求通过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);