Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 45
1-
Point out the error in the program?
#include<stdio.h>
/* Assume there is a file called 'file.c' in c:\tc directory. */
int main()
{
FILE *fp;
fp=fopen("c:\tc\file.c", "r");
if(!fp)
printf("Unable to open file.");
fclose(fp);
return 0;
}
The code copies the content of one file to another
B -
The code writes strings that are read from the keyboard into a file.
C -
The code reads a file
D -
None of above
6-
While calling the fprintf() function in the format string conversion specifier %s can be used to write a character string in capital letters.
A -
True
B -
False
7-
A text stream is an ordered sequence of characters composed into lines, each line consisting of zero or more characters plus a terminating new-line character.
A -
True
B -
False
8-
Offset used in fseek() function call can be a negative number.
A -
True
B -
False
9-
We should not read after a write to a file without an intervening call to fflush(), fseek() or rewind()
A -
True
B -
False
10-
In a call to printf() function the format specifier %b can be used to print binary equivalent of an integer.