题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-04-07 18:59:06

[填空题]下面fun函数的功能是将形参x的值转换成二进制数,所得二进制数的每一位数放在数组中返回,二进制数的最低位放在下标为0的元素中,其他依此类推。请填空。
Fun(int x,int b[])
int k=0,r;
do
r=x%2;
______=r;
x/=2;
while(x);

更多"下面fun函数的功能是将形参x的值转换成二进制数,所得二进制数的每一位"的相关试题:

[填空题]下面的函数fun的功能是将形参x的值转换成二进制数,所得二进制数的每一位放在一维数组中返回,二进制的最低位放在下标为0的元素中,其他依次类推,请填空。 fun(int x,int b[]) { int k=0,r; do { r=x% 【13】 ; b[k++]=r; x/= 【14】 ; }while(x);}
[填空题]下面程序段的功能是将形参x的值转换成二进制数,所得二进制数的每一位数放在一维数组中返回,二进制数的最低位放在下标为0的元素中,其他以此类推。
#include
main(int x,int b[])
int k=0,r,i;
scanf("%d",x);
do
r=x%2;
b[______]=r;/*第一空*/
x/=2;
while(______);/*第二空*/
for(______);i>=0;i--)/*第三空*/
printf("%d",b[i]);

[填空题]请补充fun函数,fun函数的功能是求n的阶乘。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容,仅在fun函数的横线上填入所编写的若干表达式或语句
试题程序:
#include<stdio.h>
long fun(int n)

if( (1) )
return(n*fun( (2) ));
return (3)

main( )

printf("10!=%1d/n",fun(10));


[填空题]下列程序中,fun( )函数的功能是计算x2-2x+6,主函数中将调用fun( )函数计算。
y1=(x+8)2-2(x+8)+6
y2=sin2(x)-2sin(x)+6
请填空
#include "math.h"
double fun(double x)return(x*x-2*x+6);)
main( )
double x,y1,y2;
printf("enter x:");scanf("%1f",&x);
y1=fun(______);
y2=fun(______);
printf("y1=%1f,y2=%1f/n",y1,y2);
[填空题]下列程序中,fun( )函数的功能是计算x2-2x+6,主函数中将调用fun( )函数计算。
y1=(x+8)2=2(x+8)+6
y2=sin2(x)-2sin(x)+6
请填空:
#include<math.h>
double fun(double x)return(x*x-2*x+6);
main( )
double x, y1, y2;
printf("enter x: "); scanf("%1f", &x);
y1=fun(______);
y2=fun(______);
printf("y1=%1f, y2=%1f/n", y1, y2);

[填空题]以下程序中,函数fun的功能是计算X的2次方-2x+6,主函数中将调用fun函数计算: y1=(x+8)的2次方-2(X+8)+6 y2=sin2(x)一2sin(x)+6 请填空。 #include "math.h" double fun(double X){return(X*x-2*X+6);} main( ) {double x,yl,y2; printf("Enter x:");scanf("%If",&x); y1=fun(【 】); y2=fun(【 】); printf("y1=%If,y2=%lf\n",y1,y2); }
[填空题]以下程序中,函数fun的功能是计算x2(上标)-2x+6,主函数中将调用fun函数计算:
y1=(x+8)2-2(x+8)+6
y2=sin2(x)-2sin(x)+6
请填空。
#include "math.h"
double fun(double x) return (x*x-2*x+6);
main( )
double x,y1,y2;
printf("Enter x:"); scanf("%1f",&x);
y1=fim(______);
y2=run(______);
printf("y1=%1f,y2=%1f/n",y1,y2);

[填空题]以下程序中,函数fun的功能是计算x2-2x+6,主函数中将调用fun函数计算,请填空。
y1=(x+8)2-2(x+8)+6
y2=sin2(x)-2sin(x)+6
#include "math.h"
double fun(double x) return(______);
main( )
( double x,y1,y2;
printf("Enter x:"); scanf("%1f",&x);
yl=fun(8+x);
y2=fun(______);
printf("y1 =%1f,y2=%1f/n",y1,y2);


我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码