更多"以下程序段打开文件后,先利用fseek函数将文件位置指针定位在文件末尾"的相关试题:
[填空题]以下程序段打开文件后,先利用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= 【20】 ("test.t","rb");
fscek(myf,( ),SEEK_END) ;f1+ftell(myf);
fclose(myf);
printf("%1d/n",f1);
[填空题]以下程序中,函数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( (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);