题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-12-17 02:12:41

[填空题]下列程序用来判断指定文件是否能正常打开,请填空。
#include<stdio.h>
main( )
FILE*fp;
if(((fp=fopen("test.txt","r")==______))
prinff("文件打开成功!/n");
else
printf("未能打开文件!/n");

更多"下列程序用来判断指定文件是否能正常打开,请填空。 #include<"的相关试题:

[填空题]以下程序用来判断指定文件是否能正常打开。请填空。
#include <stdio.h>
main( )
FILE *fp;
if(((fp=fopen("test.txt","r"))==______))
printf("未能打开文件!/n");
else
printf("文件打开成功!/n");

[填空题]下列程序用来判断指定文件是否能正常打开,请填空。
#include<stdio.h>
main( )
FILE*fp;
if(((fp=fopen("test.txt","r")==______))
prinff("文件打开成功!/n");
else
printf("未能打开文件!/n");

[填空题]以下程序用来判断指定文件是否能正常打开,请填空。
#include<stdio.h>
main( )
FILE*fp;
if(((fp=fopen("test.txt","r"))=______))
printf("未能打开文件!/n");
else
printf("文件打开成功!/n");

[填空题]以下程序用来判断指定文件是否能正常打开,请填空。
#include<stdio.h>
main( )
FILE*fp;
if(((fp=fopen("test.txt","r"))= ))
printf("未能打开文件!//n");
else
printf("文件打开成功!//n");

[填空题]以下程序用来统计文件中字符个数。请填空。
#include "stdio. h"
main( )
FILE *fp;long num=OL;
if((fp=fopen("fname.dat","r")==NULL)
Pirntf("Open error/n"); exit(0);
while( 【16】 )
fgetc(fp);num++;
printf("num=%1d/n",num-1);
fclose(fp);

[填空题]下面的程序用来统计文件中字符的个数。请填空。
# include<stdio.h>
main( )
FILE *fP;
long num=0;
if( (fp=fopen("fname.dat","r"))==NULL)
printf("Can’t open file! /n");sxit(0);
while ______
fgetc(fp);num++;
printr("num=%d/n",num);
fclose (fp);

[填空题]下面程序的功能是用来统计文件中字符个数。请填空。
#include"stdio.h"
main( )
long count=OL;
FILE*fp= 【16】 ("text.dat","r");
if(fp==0)
printf("Open error/n");
exit(0);

while( 【17】 )

fgetc(fp);
count++;

fclise(fp);
printf("%1d/n",count);

[填空题]以下程序用业统计文件十字符个数。请填空。
#include "stdio.h"
main( )
FTLE *fp; long num=OL;
if((fp=fopen("fname.dat","r"))==NUlL)
pirntf("Open error/n"); exit(0);
while( )
fgetc(fp); num++;
printf("num=%1d/n",num-1);
fclose(fp);

[填空题]下列程序的输出结果是16.00,请填空。
#include <stdio.h>
main( )
int a=9, b=2;
float x= 【12】 ,y=1.1,z;
z=a/2+b*x/y+1/2;
printf("%5.2f/n",z);

[填空题]以下程序的功能是:删除字符串中所有的空格。请填空。
#include<stdio.h>
main( )
char s[100]="Our teacher teach C language!"; int i, j;
 for(i=j=0; s[i]!=’/0’; i++)
  if(s[i]!=’’) s[j]=s[i]; j++;
 s[j]=______;
 printf("%s/n", s);

[填空题]以下程序用以删除字符串中所有的空格,请填空。
#include<stdio.h>
main( )
char s[100]="Our teacher teach C language!";int i,j;
for(i=j=0;s[i]!=’/0’;i++)
if(s[i]!=’’)______
s[j]=’/0’;
printf("%s/n",s);

[填空题]下面程序的功能是输出数组s中最大元素的下标,请填空。
#include <stdio.h>
main( )
int k, p,s[]=1, -9,7,2, -10,3;
for(p =0,k =p; p<6; p++)
if(s[p]>s[k])
printf("%d//n", k);

[填空题]

以下程序运行后的输出结果是()。
#include
#include
#include
main( )
{ char *p;int i;
p=(char*)malloc(sizeof(char)*20);
strcpy(p,"welcome");
for(i=6;i>=0;i--) putchar(*(p+i));
printf("/n"); free(p);
}


[单项选择]有以下程序 #include main( ) {FILE *fp; int i; char ch[]="abcd",t; fp=fopen("abc.dat", "wb+"); for(i=0;i<4;i++)fwrite(&ch[i],1,1,fp); fseek(fp,-2L,SEEK_END); fread(&,1,1,fp); fclose(fp); printf("%c\n",t); } 程序执行后的输出结果是【 】。
A. d
B. c
C. b
D. a

我来回答:

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

订单号:

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