第一范文网 - 专业文章范例文档资料分享平台

C语言模拟题

来源:用户分享 时间:2025/6/18 4:51:34 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

A”c” B”\\\\” C?m? D”\\24m”

84、能正确表达数学关系100<=s<300的表达式为( )

A (s>=100)and (s<300) B (s>=100)&& (s<300) C 100<=s<300 D (s>=100)& (s<300) 85、下列程序运算结果变量k为( )

Int a=3,b=2; Int k;

K=(--a==b++)?a:b+1

A 0 B 2 C 1 D 3

86、不能对2维数组a进行初始化的是( )A int a[3][2]={{1,2,3},{4,5,6}} B int a[3][2]={{1},{2,3},{4,5}} C int a[3][2]={1,2,3,4,5}

D int a[][2]={{1,2},{3,4},{5,6}} 87、以下结果为( )

char str[3][2]={?a?,?b?,?c?,?d?,?e?,?f?} str[2][0]=?\\0?

printf(“%s”,str[0])

A ab B abcd0 C abcd0f Dabcd 88、下列结果( )

#include F(m.n) m*n main

{int x=5,y=3,a1,a2; a1=F(x+y,x-y) a2=F(x-y,x+y)

printf(“%d%d”,a1,a2) }

A 16 ,16 B -7,17 C 17,-7 D 16,-16

89、表达式xp+4的值( ) Char a[]=”china” Char xp X=a

A ?u? B 存放u的地址 C ?a?

D存放a 的地址

二.编程题

1、.打开程序4-1,完成其中fun()的函数,使其计算: 1, (x<=0); Fun(x)= [26+|x|]/[3+sin(x)] , x>0

#include #include double fun(float x) { /**/ double y; if(x<=0) y=1; else

y=(26+fabs(x))/(3+sin(x)); return y; /**/ }

void main() {

float x; double y;

printf(\ scanf(\ y = fun(x);

printf(\ getch(); } 2、

#include void main()

{ /**/long p=1; /**/ int i=1; do{

p=p*i; i=i+1;

}while(/**/i<=10 /**/);

printf(\ getch(); } 3、

#include #include void main() {

int a,b,temp;

scanf(\

/**/ if (ab) {

temp=a; a=b; b=temp; }

while(++a

if(a%2 == 0)

/**/ b++; /**/ continue; printf(\ }

printf(\ getch(); } 4、

#include #include void asc(int b[], int n) { int i, j, k, temp;

for( i = 0; i < n-1; i++ ) { k = i;

for( j=i+1; j< n ; /**/j++ /**/) if( b[j] < b[k] ) /**/k=j /**/; if( k != i ) { temp = b[k];

b[k]= /**/b[i] /**/; b[i] = temp ; } } }

void main() {

int b[] = {12,25,8,32,23,15,37,4}; int i,n = sizeof(b)/sizeof(int); asc(b,n);

for(i=0;i

printf(\ \ printf(\ getch(); } 5、

#include #include double fun1(float x) { /**/ double y; if(x<8)

搜索更多关于: C语言模拟题 的文档
C语言模拟题.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c2oh0r79et39emep57bnk_3.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top