选择题 有以下程序:
#include<stdio.h>
void fun(char*c,int d)
{*c=*c+1;
d+=1;
printf('%c,%c',*c,d);
}
main()
{chara='F',b='f';
fun(b,a);
printf('%c,%c\n',a,b);
}
程序的输出结果为______。
选择题 有以下程序
#include<stdio.h>
void fun(int x)
{if(x/2>1) fun(x/2);
printf('%d', x);
}
main()
{ fun(7); printf('n'); }
程序运行后的输出结果是______。
选择题 有以下程序:
#include<stdio.h>
main()
{int a=0,b=0,c=0,d=0;
if(a=1)b=1;c=2;
else d=3;
printf('%d,%d,%d,%d\n',a,b,c,d);
}
程序的运行结果是______。
选择题 下列叙述中正确的是______。
选择题 若变量均已正确定义并赋值,以下合法的C语言赋值语句是______。
选择题 以下叙述中正确的是______。
选择题 有以下程序:
#include<stdio.h>
main()
{int a[5]={1, 2, 3, 4, 5}, b[5]={0, 2, 1, 3, 0}, i, s=0;
for(i=0; i<5; i++) s=s+a[b[i]];
printf('%d\n', s);
}
程序运行后的输出结果是______。
选择题软件详细设计产牛的图如下:该图是______。
选择题 若有以下程序
#include<stdio.h>
main()
{ int a=-11,b=10;
a/=b/=-4;
printf('%d %d\n',a,b);
}
则程序的输出结果是______。
选择题 若有以下程序:
#include <stdio.h>
main()
{ int a=6,b=0,c=0;
for(;a;){b+=a;a-=++c;}
printf('%d,%d,%d\n',a,b,c);
}
则程序的输出结果是______。
选择题 下面是有关C语言字符数组的描述,其中错误的是______。
选择题 以下选项中叙述正确的是______。
选择题 在数据管理技术发展的三个阶段中,数据共享最好的是______。
选择题 有以下程序段
char ch;int k;
ch='a';k=12;
printf('%c,%d,',ch,ch,k);
printf('k=%d\n',k);
已知字符a的ASCII十进制代码为97,则执行上述程序段后输出结果是______。
选择题 有以下程序:
main()
{int a=0, b=0;
a=10; /*给a赋值
b=20; 给b赋值 */
printf('a+b=%d\n', a+b); //输出计算机结果
}
程序运行后的输出结果是______。
选择题 有以下程序:
#include <stdio.h>
main()
{ int x;
scanf('%d',x);
if(x<=3); else
if(x!=10) printf('%d\n',x);
}
程序运行时,输入的值在哪个范围才会有输出结果______。
选择题 以下4个选项中,不能看作一条语句的是______
填空题 请补充函数proc(),该函数的功能是:删去一维数组中所有相同的数,使之只剩一个。数组中的数已按由小到大的顺序排列,函数返回删除后数组中数据的个数。
例如,若一维数组中的数据是:1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 8 10 10。
删除后,数组中的内容应该是:1 2 3 4 5 6 7 8 10。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#define M 80
int proc(int arr[], int n)
{
int i, t, j=0;
t=arr[0];
for(i=1; i<n; i++)
if(______)
;
else
{
______;
t=arr[i];
}
arr[j++]=t;
return j;
}
void main()
{
int arr[M]={1, 1, 2, 2, 2, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 10, 10}, i, n=18;
printf('The original data: \n');
for(i=0; i<n; i++)
printf('%4d', arr[i]);
n=proc(arr, n);
printf('\n\nThe data after deleted; \n');
for(i=0; i<n; i++)
printf('%4d', arr[i]);
printf('\n');
}
填空题给定程序中,函数fun的功能是计算下式直到,并把计算结果作为函数值返回。例如,若形参e的值为1e-3,函数的返回值为2.985678。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。不得增行或删行,也不得更改程序的结构!给定源程序:#include<stdio.h>doublefun(doublee){inti;doubles,x;/**********found**********/s=0;i=______;x=1.0;while(x>e){/**********found**********/______;/**********found**********/x=(2.0*i-1)/((______)*(2.0*i));s=s+x;}returns;}main(){doublee=1e-3;printf('\nTheresultis:%f\n',fun(e));}
填空题 给定程序通过定义并赋初值的方式,利用结构体变量存储了一名学生的学号、姓名和3门课的成绩。函数modify的功能是将该学生的各科成绩都乘以一个系数a。
请在程序的下划线处填入正确的内容,使程序得出正确的结果。
注意:部分源程序给出如下。
不得增行或删行,也不得更改程序的结构!
试题程序:
#include<stdio.h>
typedef struct
{int num;
char name[9];
float score[3];
}STU;
void show(STU tt)
{int i;
printf('%d %s:',tt.num.tt.name);
for(i=0;i<3;i++)
printf('%5.1',tt.score[i]);
printf('\n');
}
/**********found**********/
void modify(______*ss,float a)
{int i;
for(i=0;i<3;i++)
/**********found**********/
ss->______;*=a;
}
main()
{STU std={1,'Zhanghua',76.5,78.0,82.0};
float a;
printf('\nThe original number and nameand scores:\n');
show(std);
printf('\nInput a number:');
scanf('%f',a);
/**********found**********/
modify(______,a);
printf('\nA result of modifying:\n');
show(std);
}