单选题设i和x都是int类型,则以下for循环语句______。 for(i=0, x=0;
i<=9 i++) scanf("% d", x);
A.最多执行10次
B.最多执行9次
C.是无限循环
D.循环体一次也不执行
单选题下面程序的输出结果是 #include<stdio.h> #include<string.h> main() char*p1="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2,streat(p1,p2)); printf("%s/n",str); A) xyzabcABC B) zabcABC C) xyabcABC D) yzabcABC
单选题已知字母a的ASCII码为十进制数的97,下面程序的输出结果是______。 main() { char c1,c2; c1='a'+'5'-'3'; c2='a'+'6'-'3'; printf("%c,%d/n",c1,c2); }
单选题以下选项中,合法的C语言实数是______。
A.3.1e0.4
B..2e0
C.E13
D.7.12E
单选题下列叙述中错误的是
A. 在程序中凡是以“#”开始的语句行都是预处理命令行
B. 预处理命令行的最后不能以分号表示结束
C. #define MAX是合法的宏定义命令行
D. C程序对预处理命令行的处理是在程序执行的过程中进行的
单选题有以下程序:
#include <stdio.h>
main()
{char ch[3][5]={"AAAA", "BBB", "CC"};
printf("%s/n", ch[1]);
}
程序运行后的输出结果是______。
单选题若有以下程序段 struct st int n;struct st*next;; struct st a[3]=5,&a[1],7,&a[2],9,'/0',*p; p=&a[0]; 则以下选项中值为6的表达式是______。 A.++(p->n) B.(*p).n C.p->n++ D.p->n
单选题有以下程序: #include<stdio.h> main() { float a,b,c,t; a=3;b=7;c=1; if(a>b) {t=a;a=b;b=t;} if(a>c) {t=a;a=c;c=t;} if(b>c) {t=b;b=c;c=t;} printf("%5.2f,%5.2f,%5.2f",a,b,c); } 程序运行后的输出结果是(其中口代表空格)( )。
单选题以下程序函数f的功能是:当flag为1时,进行由小到大排序;当flag为0时,进行由大到小排序 void f(int b[],int n,int flag) main() {int i,j,t; {int a[10]={5,4,3,2,l,6,7,8,9,10),i; for(i=0;i<n一1;i++) f(&a[2],5,0);f(a,5,1); for(j=i+1;j<n;j++) for(i=0;i<10;i++)printf("%d,",a[i]); if(flag?b[i]>b[j]:b[i]<b[j]) } {t=b[i];b[i]=b[j];b[j]=t;}}程序运行后的输出结果是
单选题下面程序的输出是______。 main() int x=3,y=6,a=0; while(x++!=(y-=1)) a+=1 if(y<x)break; printf("x=%d,y=%d,=%d/n",x,y,a); A) x=4,y=4,a=1 B) x=5,y=5,a=1 C) x=5,y=4,a=3 D) x=5,y=4,a=1
单选题有如下程序: #include <stdio.h>
main() { int i,data;
scanf("%d",
for(i=0;i<5;i++) {
if(i<data) continue;
printf("%d,",i); }
printf("/n"); }
程序运行时,从键盘输入:3<回车>后,程序输出结果为______。
A.3,4,
B.1,2,3,4,
C.0,1,2,3,4,5,
D.0,1,2,
单选题下列合法的标识符是______。
单选题有以下程序: #include <sldio.h> main() int x=0,y=5,z=3; while(z-->0 printf("%d,%d,%d/n",x,y,z); 程序执行后的输出结果是( )。 A) 3,2,0 B) 3,2,-1 C) 4,3,-1 D) 5,-2,-5
单选题设有一联合体变量定义如下: union data { long a; float b: int c: char d: }; union data x: 执行下列语句后,正确的联合体变量x的值是 ( )。 x.a=111111, x.b=2222; x.c=2.1546; x.d='R';
单选题有以下程序:
#include<stdlib.h>
struct NODE
{ int num;stmct NODE *next;};
main( )
{ struct NODE * p, * q,* r;
p=(struct NODE * )malloc(sizeof(struct NODE) );
q=(struct NODE * )malloc(sizeof(struct NODE) );
r=(struct NODE * )malloc(sizeof(struct NODE) );
p->num=10; q->num=20; r->num=30;
p->next=q; q->next=r;
printf("%d/n",p->num+q->next->num);
}
程序运行后的输出结果是( )。
单选题以下叙述中正确的是
单选题若有定义:
int w[3][5];
则以下不能正确表示该数组元素的表达式是______。
单选题以下关于C语言的叙述中正确的是______。
单选题有以下程序:
#include<stdio.h>
main()
{
int x=8;
for(;x>0;x--)
{
if(x%3)
{
printf("%d,",x--);
contmue;
}
printf("%d,",-x);
}
}
程序运行后的输出结果是______。
单选题有以下定义和语句: struct workers int num; char name[20]; char c; struct int day; int month; int year; s; ; struct workers w, *pw; pw= 能给w中year成员赋值1980的语句是