问题

要求通过 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 fun(int *p){ return *p;)fun 函数返回值是A) 不确定的值B) 一个整数C) 形参 P 中存放的值D) 形参 P 的地址值
  • 若有说明语句 : double *p,a; 则能通过 scanf 语句正确给输入项读入数据的程序段是A)*p=&a; scanf( % 1f,p);B)*p=&a; scanf( % f,p)
  • 有以下程序段struct st{int x;int *y;)*pt;int a[]={l,2},b[]={3,4};struct st c[2]={10,a,20,b};pt=c;以下选项中表达式的值
  • 设 fp 为指向某二进制文件的指针,且已读到此文件末尾,则函数 feof(fp) 的返回值为A)EOFB) 非 0 值C)0D)NULL
  • 设有以下语句int a=1,b=2,c;c=a ^ (b$amp;A)6B)7C)8D)9
  • 有以下程序#include main(){ char c1,c2,c3,c4,c5,c6;scanf( % c % c % c % c,&c1,&c2,&c3,&c4);c5=g