QUIZ ON : C LANGUAGE - FILE PROCESSING

FILE PROCESSING

00:00:00

End of file is detected by

Option A. fend( )
Option B. endf( )
Option C. EOF
Option D. FEND
True Answer C

Explanation :

End of file is detected by

Question No# : 01 out of 11

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# : 02 out of 11

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# : 03 out of 11

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# : 04 out of 11

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# : 05 out of 11



What is the purpose of getc()?

Option A. read a character from STDIN
Option B. read a character from a file
Option C. read all file
Option D. read file randomly
True Answer B

Explanation :

What is the purpose of getc()?

Question No# : 06 out of 11

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# : 07 out of 11



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# : 08 out of 11

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# : 09 out of 11

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# : 10 out of 11

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# : 11 out of 11