QUIZ ON : C LANGUAGE - FILE PROCESSING

FILE PROCESSING

00:00:00

In relational schema each tuple is divided into fields called relations.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

In relational schema each tuple is divided into fields called relations.

Question No# : 01 out of 20



Using fprintf function, we can print on the standard output device.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

Using fprintf function, we can print on the standard output device.

Question No# : 02 out of 20



In a multilist organisation

Option A. records that have an equivalent value for a given secondary index item are linked together to form a list
Option B. records are loaded in ordered sequence defined by collating sequence by content of key
Option C. records are directly accessed by records key field
Option D. none of the above
True Answer C

Explanation :

In a multilist organisation

Question No# : 03 out of 20



Which function will return the current file position for stream?

Option A. fgetpos()
Option B. fseek()
Option C. ftell()
Option D. fsetpos()
True Answer C

Explanation :
The current file position is returned by ftell() function for stream, or -1L on error.

Which function will return the current file position for stream?

Question No# : 04 out of 20



Choose the correct difference between getc() and fgetc().

Option A. If it is not a macro, it may evaluate stream more than once
Option B. if it is amacro, it may not evaluate stream more than once
Option C. if it is a macro, it may evaluate stream more than once
Option D. no difference between fgetc() and getc()
True Answer C

Explanation :
getc() is equivalent to fgetc() except that if it is a macro, it may evaluate more than once.

Choose the correct difference between getc() and fgetc().

Question No# : 05 out of 20



What does fp point to in the program?


int main()
{
FILE *fp;
fp=fopen("trial", "r");
return 0;
}

Option A. The first character in the file
Option B. A structure which contains a char pointer which points to the first character of a file
Option C. The name of the file
Option D. The last character in the file
True Answer B

Explanation :

What does fp point to in the program?


int main()
{
FILE *fp;
fp=fopen("trial", "r");
return 0;
}

Question No# : 06 out of 20



Which of the following true about FILE *fp

Option A. FILE is a keyword in C for representing files and fp is a variable of FILE type.
Option B. FILE is a structure and fp is a pointer to the structure of FILE type
Option C. FILE is a stream
Option D. FILE is a buffered stream
True Answer B

Explanation :
fp is a pointer of FILE type and FILE is a structure that store following information about opened file.

Which of the following true about FILE *fp

Question No# : 07 out of 20



A command that lets you change one or more fields in a record is look up.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

A command that lets you change one or more fields in a record is look up.

Question No# : 08 out of 20



getc() returns EOF when

Option A. End of files is reached
Option B. When getc() fails to read a character
Option C. Both of the above
Option D. None of the above
True Answer C

Explanation :

getc() returns EOF when

Question No# : 09 out of 20



The fprintf() function can be used to display the output on the screen.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer B

Explanation :

The fprintf() function can be used to display the output on the screen.

Question No# : 10 out of 20



FILE is of type ______

Option A. int type
Option B. char * type
Option C. struct type
Option D. None of the mentioned
True Answer C

Explanation :

FILE is of type ______

Question No# : 11 out of 20



The statement fopen("data.txt", "w+") will open a file named data.txt for both reading and writing.

Option A. TRUE
Option B. FALSE
Option C.
Option D.
True Answer A

Explanation :

The statement fopen("data.txt", "w+") will open a file named data.txt for both reading and writing.

Question No# : 12 out of 20



The two type of file structures existing in VSAM file are

Option A. Key sequenced structures, entry sequenced structures
Option B. Key sequenced structure, exit sequenced structures
Option C. Entry sequenced structures, exit sequenced structures
Option D. None of the above
True Answer C

Explanation :

The two type of file structures existing in VSAM file are

Question No# : 13 out of 20



In C language, FILE is of which data type?

Option A. int
Option B. char *
Option C. struct
Option D. None of the mentioned
True Answer C

Explanation :

In C language, FILE is of which data type?

Question No# : 14 out of 20



If there is any error while opening a file, fopen will return

Option A. Nothing
Option B. EOF
Option C. NULL
Option D. Depends on compiler
True Answer C

Explanation :

If there is any error while opening a file, fopen will return

Question No# : 15 out of 20



Which one of the following is correct syntax for opening a file.

Option A. FILE *fopen(const *filename, const char *mode)
Option B. FILE *fopen(const *filename)
Option C. FILE *open(const *filename, const char *mode)
Option D. FILE open(const*filename)
True Answer A

Explanation :
fopen() opens the named file, and returns a stream, or NULL of the attempt fails.

Which one of the following is correct syntax for opening a file.

Question No# : 16 out of 20



fseek() should be preferred over rewind() mainly because

Option A. rewind() doesn't work for empty files
Option B. rewind() may fail for large files
Option C. In rewind, there is no way to check if the operations completed successfully
Option D. All of the above
True Answer C

Explanation :

fseek() should be preferred over rewind() mainly because

Question No# : 17 out of 20



If a file is open in ‘write’ mode, then

Option A. If it does not exist, an error is returned
Option B. If it does not exist, it is created
Option C. If it exists, then data is written at the end
Option D. If it exists, error is returned
True Answer B

Explanation :
In C, fopen() is used to open a file in different modes. To open a file in write mode, “w” is specified. When mode “w” is specified, it creates an empty file for output operations. If a file with the same name already exists, its contents are discarded and the file is treated as a new empty file.

If a file is open in ‘write’ mode, then

Question No# : 18 out of 20



What is the function of the mode ‘ w+’?

Option A. create text file for writing, discard previous contents if any
Option B. create text file for update, discard previous contents if any
Option C. create text file for writing, do not discard previous contents if any
Option D. create text file for update, do not discard previous contents if any
True Answer B

Explanation :
w+ is a mode used to open a text file for update (i. e., writing and reading), discard previous contents if any.

What is the function of the mode ‘ w+’?

Question No# : 19 out of 20



The first and second arguments of fopen are ______

Option A. A character string containing the name of the file & the second argument is the mode
Option B. A character string containing the name of the user & the second argument is the mode
Option C. A character string containing file poniter & the second argument is the mode
Option D. None of the mentioned
True Answer A

Explanation :

The first and second arguments of fopen are ______

Question No# : 20 out of 20




CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad