题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-01-09 21:43:02

[填空题]以下程序打开新文件f.txt,并调用字符输出函数将a数组中的字符写入其中。请填空。
#include<stdio.h>
main( )
 ______ *fp;
 char a[5]=’1’, ’2’, ’3’, ’4’, ’5’, i;
 fp=fopen("f.txt", "w");
 for(i=0;i<5;i++) fputc(a[i], fp);
 fclose(fp);

更多"以下程序打开新文件f.txt,并调用字符输出函数将a数组中的字符写入其"的相关试题:

[填空题]以下程序打开新文件f.txt,并调用字符输出函数将a数组中的字符写入其中,请填空。
#include <stdio.h>
main( )
______*fp;
char a[5]=’1’,’2’,’3’,’4’,’5’),i;
fp=fopen("f.txt", "w");
for(i=0; 1<5; i++) fputc(a[i],fp);
fclose(fp);

[填空题]以下程序中,函数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( (8) );
main( )
( double x,y1,y2;
printf("Enter x:"); scanf("%1f",&x);
yl=fun(8+x);
y2=fun( (9) );
printf("y1 =%1f,y2=%1f/n",y1,y2);


[填空题]以下程序段打开文件后,先利用fseek函数将文件位置指针定位在文件末尾,然后调用 ftell函数返回当前文件位置指针的具体位置,从而确定文件长度。请填空。
FILE * myf;long f1;
myf= 【20】 ("test.t","rb");
fseek(myf,0,SEEK END) ;
f1=ftell(myf);
fclose(myf);
printf("%d/n",f1);
[填空题]以下程序段打开文件后,先利用fseek函数将文件位置指针定位在文件末尾,然后调用ftell函数返回当前文件位置指针的具体位置,从而确定文件长度。请填空。
FILE *myf; long f1;
myf=______("test,t","rb");
fseek(myf,0,SEEK_END) ;f1=ftell(myf);
fclose(myf);
printf("%1d/n",f1);
[填空题]以下程序段打开文件后,先利用fseek函数将文件位置指针定位在文件末尾,然后调用删函数返回当前文件位置指针的具体位置,从而确定文件长度,请填空。
FILE*myf;long fl;
myf= 【15】 ("test.t","rb");
fseek(myf,( ),SEEK_END);fl+ftell(myf);
fclose(myf);
printf("%d/n",fl);
[填空题]以下程序中,函数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); }
[填空题]以下程序调用函数swap将指针s和t所指单元(a和b)中的内容交换,请填空。
main( )
int a=10,b=20,*s,*t;
s=&a;t=&b;
______
printf("%d%d",a,b);

swap(int*ss,int*tt)
int te;
te=*ss;
*ss=*tt;
*tt=te;

[填空题]以下程序调用函数swap_p将指针s和t所指单元(a和b)中的内容交换,请填空。
main( )
int a=10,b=20,*s,*t;
s=&a;t=&b;
swap_p( 【13】 );
printf("%d%d,a,b");
swap_p(int**ss,int**tt)
int term;
term=**ss;
**ss=**tt;
**tt=term;
[填空题]设函数findbig已定义为求3个数中的最大值。以下程序将利用函数指针调用findbig函数。请填空。
main( )
int findbig(int,int,int);
int (*f) ( ) ,x,y, z,big;
f=______;
scanf("%d%d%d",&x,&y,&z:
big=(*f)(x,y,Z);
printf("big=%d/n",big);

我来回答:

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

订单号:

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