AI智能整理导入 AI智能整理导入
×
首页 题库中心 c语言程序设计题库 题目详情
CA85E835B92000012B50FB49F93816B5
c语言程序设计题库
1,073
单选题

阅读以下程序及对程序功能的描述, 其中正确的描述是( ) 。
# include
main ( )
{
FILE *in , *out ;
char ch , infile [ 10 ] , outfile [ 10 ] ;
printf (“Enter the infile name : \ n” ) ;
scanf (“ % s”, infile ) ;
printf ( “Enter the outfile name : \n” ) ;
scanf ( " % s " , outfile ) ;
if ( ( in = fopen ( infile ,”r " ) ) = = NULL )
{
printf ( “cannot open infile \ n”) ;
exit ( 0 ) ;
}
if ( ( out = fopen ( outfile , “w” ) ) ==NULL )
{
printf (”cannot open outfile \n”) ;
exit ( 0 ) ;
}
while ( !feof (in))fputc(fgetc(in), out) ;
fclose ( in ) ;
fclose ( out ) ;
}

A
程序完成将一个磁盘文件复制到另一个磁盘文件中
B
程序完成将磁盘文件的信息在屏幕上显示的功能
C
程序完成将两个磁盘文件合二为一的功能
D
程序完成将两个磁盘文件合并且在屏幕上输出

答案解析

正确答案:A

解析:

文件与位运算
c语言程序设计题库

扫码进入小程序
随时随地练习

相关题目

单选题

若有语句: CHAR *LINE[5]; 以下叙述中正确的是( )

单选题

有以下程序段
struct NODE
{
int num;
struct NODE *next;
} OLD;
以下叙述中正确的是( )

单选题

有以下程序
void main(void)
{ int a[]={1, 2, 3, 4, 5, 6, 7, 8, 9, 0} , *p;
p = a;
printf("%d\n", *(p + 2) )
}
结果为( )

单选题

以下程序输出结果为( )
#define S(r) r * r
void main(void)
{
printf("%d", S( 2 * 2 ) ) ;
}

单选题

以下程序的运行结果是( )
#include
void main(void)
{
int nA = 100, nB = 200;
nB = nB *= nA;
nA = nB += nA;
printf("%d", nA) ;
return;
}

单选题

以下程序的运行结果是( )
#include
void main(void)
{
char CArray[9] = {' a' , ' b' , ' c' , ' d' , ' e' , ' f' , ' g' , ' h' , ' \0' } ;
char* ptr = NULL;
ptr = &CArray[3];
*ptr = ' t' ;
printf("%s\n", CArray) ;
printf("%c", CArray[4]) ;
return;
}

单选题

有如下程序,能计算出十位数数字的表达式是( ):
#include
void main(void)
{
int nNumber = 0;
int nS = 0; //表示十位数字
printf("请输入一个三位数: \n") ;
scanf("%d", &nNumber) ;
}

单选题

关于 c 语言中文件操作, 以下说法错误的是( )

单选题

#include
void main(void)
{
FILE* pFile = fopen("d: \\date. txt", "w") ;
int nI = 5;
fprintf(pFile, "nI = %4d", nI) ;
fclose(pFile) ;
}
如果 d 盘目录下没有 date. txt 这个文件, 程序执行结果是( )

单选题

有以下程序
void main(void)
{
int k=1;
switch(k)
{
default: break;
case 1: k++;
case 2:
case 3: k++;
}
printf("%d\n", k) ;
}
结果为( )

关闭
专为自学备考人员打造
试题通
自助导入本地题库
试题通
多种刷题考试模式
试题通
本地离线答题搜题
试题通
扫码考试方便快捷
试题通
海量试题每日更新
试题通
欢迎登录试题通
可以使用以下方式扫码登陆
试题通
使用APP登录
试题通
使用微信登录
xiaochengxu
联系电话:
400-660-3606
xiaochengxu