0% found this document useful (0 votes)
32 views2 pages

St. Joseph's College of Engineering St. Joseph's Institute of Technology

The document contains questions for a practice exam on programming in C for file input/output. It covers topics like what a file is, how to open and close files, command line arguments, sequential vs random access files, common file functions like rewind(), fseek(), ftell(), differences between text and binary files, file pointers, reasons for using files, and the purpose of feof(). It asks students to write programs to create and copy files, search a data file randomly, insert/update/delete records in a random access file telephone directory, and perform other file manipulation tasks.

Uploaded by

ANITHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

St. Joseph's College of Engineering St. Joseph's Institute of Technology

The document contains questions for a practice exam on programming in C for file input/output. It covers topics like what a file is, how to open and close files, command line arguments, sequential vs random access files, common file functions like rewind(), fseek(), ftell(), differences between text and binary files, file pointers, reasons for using files, and the purpose of feof(). It asks students to write programs to create and copy files, search a data file randomly, insert/update/delete records in a random access file telephone directory, and perform other file manipulation tasks.

Uploaded by

ANITHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

St.

Joseph’s College of Engineering


St. Joseph’s Institute of Technology
St. Joseph’s Group of Institutions
OMR, Chennai -119.
I year B. E /B. Tech 2019-2020
PROGRAMMING IN C – II SEM (CS8251)
Questions for Practice (Unit – V)
PART A
1. What is a File?
2. How do you open a file?

3. How do you close a file?

What do you mean by Command line arguments? (or) What does argv and argc indicate in
4. command- line argument? (APR/MAY 2018) (APRIL/MAY 2019)

5. What is the use of rewind () function?

6. What is sequential access file?

7. What is Random access file?

8. Mention any five file functions. (Jan 2014)

9. Define what is the advantage of a random access file?

10. Define How do you search data in a data file using random access method?
Write a program in C language to create a data file.
11.
12. Write a program to copy contents of input.txt file to output.txt file.
13. What is the use of fseek() function?

14. Why ftell() method is used in C files?

15. Compare Text file and Binary file.


16. Define File Pointer in C.

17. Why files are needed? (APRIL/MAY 2019)

18. What is purpose of library function feof()?

19 Write about the basic operations on files?

20 How can you restore a redirected standard streams?

PART B
1. Insert, update, delete and append telephone details of an individual or a company into a
telephone directory using random access file.

Explain in detail various functions for sequential file manipulations and operations. Explain
2.
in detail various operations that can be done on the file giving suitable examples.
(APR/MAY 2019)

Explain in detail random access in files along with the functions used for the same in C. Give
3. suitable examples. (APR/MAY 2019)

a) Write the C program to find the number of lines in a file.


4 b) Write the C program to print contents in reverse order of a file.

You might also like