Please login

Prime

Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

TCS NQT Questions on File Handling Quiz- 1

Question 1

Time: 00:00:00
The value of EOF is _____

-1

-1

2

2

1

1

10

10

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

A

Start

Question 2

Time: 00:00:00
Which of the following true about FILE *fp ?

FILE is a keyword in C for representing files and fp is a variable of FILE type.

FILE is a keyword in C for representing files and fp is a variable of FILE type.

FILE is a structure and fp is a pointer to the structure of FILE type

FILE is a structure and fp is a pointer to the structure of FILE type

FILE is a stream

FILE is a stream

FILE is a buffered stream

FILE is a buffered stream

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

B

Start

Question 3

Time: 00:00:00
The first and second arguments of fopen are ______ ?

A character string containing the name of the file & the second argument is the mode.

A character string containing the name of the file & the second argument is the mode.

A character string containing the name of the user & the second argument is the mode

A character string containing the name of the user & the second argument is the mode

A character string containing file poniter & the second argument is the mode

A character string containing file poniter & the second argument is the mode

None of the mentioned

None of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

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

Nothing

Nothing

EOF

EOF

NULL

NULL

Depends on compiler

Depends on compiler

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
fseek() should be preferred over rewind() mainly because

rewind() doesn’t work for empty files

rewind() doesn’t work for empty files

rewind() may fail for large files

rewind() may fail for large files

In rewind, there is no way to check if the operations completed successfully

In rewind, there is no way to check if the operations completed successfully

All of the above

All of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
FILE is of type ______

int type

int type

char * type

char * type

struct type

struct type

None of the mentioned

None of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
FILE reserved word is defined in ?

A structure tag declared in stdio.h

A structure tag declared in stdio.h

One of the basic datatypes in c

One of the basic datatypes in c

Pointer to the structure defined in stdio.h

Pointer to the structure defined in stdio.h

It is a type name defined in stdio.h

It is a type name defined in stdio.h

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
getc() returns EOF when ?

End of files is reached

End of files is reached

When getc() fails to read a character

When getc() fails to read a character

Both of the above —

Both of the above —

None of the above

None of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
Which of the following functions from “stdio.h” can be used in place of printf() ?

fputs() with FILE stream as stdout.

fputs() with FILE stream as stdout.

fprintf() with FILE stream as stdout.

fprintf() with FILE stream as stdout.

fwrite() with FILE stream as stdout.

fwrite() with FILE stream as stdout.

All of the above three – a, b and c.

All of the above three – a, b and c.

In “stdio.h”, there’s no other equivalent function of printf()

In “stdio.h”, there’s no other equivalent function of printf()

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
fputs adds newline character

True

True

False

False

Depends on the standard

Depends on the standard

Undefined behaviour

Undefined behaviour

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 11

Time: 00:00:00
puts function adds newline character

True

True

False

False

Depends on the standard

Depends on the standard

Undefined behaviour

Undefined behaviour

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Buy TCS NQT Paid Materials

Paid Materials TCS NQT

Join TCS NQT Online Classes

Completed

0/0

Accuracy

0%

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Comments