选择题 以下程序运行后的输出结果是
#include<stdio.h>
main
{ int x=1,y=0,a=0,b=0;
switch(x)
{ case 1:
switch(y)
{ ease 0:a++;break;
ease 1:b++;break;
}
ease 2:a++;b++;break;
case 3:a++:b++:
}
printf('a=%d,b=%d\n',a,b);
}
选择题 下列关于栈的叙述中,正确的是______。
选择题 设有定义:int n=1234;double x=3.1415;,则语句:printf('%3d,%1.3f\n',n,x);的输出结果是______。
选择题 有以下程序:
#include<stdio.h>
main()
{int x=1, y=0;
if(!x)y++;
else if(x==0)
if(x)y+=2;
else y+=3;
printf('%d\n', y);
}
程序运行后的输出结果是______。
选择题 以下结构体说明和变量定义中,正确的是______。
选择题 有以下程序
#include<stdio.h>
main()
{ int i=5;
do
{ if(i%3==1)
if(i%5==2)
(printf('%d',i);break;}
i++;
} while(i!=0);
printf('\n'1);
}
程序的运行结果是______。
选择题 以下叙述中错误的是______。
选择题 下列函数的功能是______。
void fun(char*a,char*b)
{
while((*b=*a)!='\0')
{a++;b++;}
}
选择题 以下函数值的类型是______。
fun(double x)
{foat y;
y=3*x-4;
return y;
)
选择题 已定义以下函数
int fun(int*p)
{return*p;}
fun函数返回值是______。
选择题 现有以下程序段:
#include <stdio.h>
main()
{ int k[30]={12, 324, 45, 6, 768, 98,21, 34, 453, 456};
int count=0, i=0;
while(k[i])
{ if(k[i] % 2==0||k[i] % 5==0) count++;
i++ }
printf('% d, % d\n', count, i); }
则程序段的输出结果是______。
选择题 以下非法的定义语句是
选择题若已建立以下链表结构,指针p、s分别指向如图所示结点:则不能将s所指结点插入到链表末尾的语句组是______。
选择题 要求通过while循环不断读入字符,当读入字母N时结束循环。若变量已正确定义,以下正确的程序段是______。
选择题以下程序的功能是计算:。#include<stdio.h>main(){intn;floats;s=1.0;for(n=10;n>1;n--)s=s+1/n;printf('%6.4f\n',s);}程序运行后输出结果错误,导致错误结果的程序行是。
选择题 有以下程序:
#include <stdio.h>
#define N 2
#define M N+1
#define NUM (M+1) * M/2
main( )
{ printf('%d\n',NuM);
}
程序运行后的输出结果是______。
选择题 下列字符数组初始化语句中,不正确的是______。
选择题 有以下程序
#include<stdio.h>
main()
{ int a[3]={0},i,j,k=2;
for(i=0;i<k; i++)
for(j=0; j<k; j++) a[j]=a[i]+1;
printf('%d\n',a[1]);
}
程序运行后的输出结果是______。
选择题 程序段:int x=12; double y=3.141593; printf('%d%8.6f', x, y);的输出结果是______。
选择题 有如下程序段:
int *p,a=1;
p=a;
*p=10;
则变量a的值为______。
