Log In Register

Units


File Access - Questions and Answers

 

Practice these File Access under C Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on File Access for following purpose.


– Anyone who is wishing to increase their perfect knowledge of File Access of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically File Access.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on File Access under C Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  File Access topic of C Programming:

 

1.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         FILE *fp = stdout;
  5.         int n;
  6.         fprintf(fp, "%d\n ", 45);
  7.         fprintf(stderr, "%d ", 65);
  8.         return 0;
  9.     }

Answer: Option D

Explanation:

2.

Which of the following fopen statements are illegal?

Answer: Option D

Explanation:

3.

When a C program is started, O.S environment is responsible for opening file and providing     pointer for that file?

Answer: Option D

Explanation:

4.

Which of the following mode argument is used to truncate?

Answer: Option B

Explanation:

5.

Which is true about getc.getc returns?

Answer: Option C

Explanation:

6.

Which type of files can’t be opened using fopen()?

Answer: Option D

Explanation:

7.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     #include <stdlib.h>
  3.     int main()
  4.     {
  5.         FILE *fp = stdout;
  6.         int n;
  7.         fprintf(fp, "%d", 45);
  8.     }

Answer: Option C

Explanation:

8.

FILE reserved word is

Answer: Option A

Explanation:

9.

The first and second arguments of fopen are

Answer: Option C

Explanation:

10.

What does the following segment of code do?
    fprintf(fp, “Copying!”);

Answer: Option C

Explanation:

11.

stdout, stdin and stderr are

Answer: Option D

Explanation:

12.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         FILE *fp = stdout;
  5.         int n;
  6.         fprintf(fp, "%d ", 45);
  7.         fflush(stdout);
  8.         fprintf(stderr, "%d", 65);
  9.         return 0;
  10.     }

Answer: Option C

Explanation:

13.

FILE is of type ______

Answer: Option A

Explanation:

14.

Which of the following statements about stdout and stderr are true?

Answer: Option B

Explanation:

15.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         FILE *fp = stdin;
  5.         int n;
  6.         fprintf(fp, "%d", 45);
  7.     }

Answer: Option B

Explanation: