2nd Year Computer Chapter 14 Notes
Important full 2nd Year Computer Chapter 14 Notes written by Professor Mr. Tayyab Shahzad. These notes are very helpful in the preparation of 2nd year computer chapter 14 important questions of 2nd year Computer Science for the students of the intermediate and these are according to the paper patterns of all Punjab boards.
Summary and Contents:
Topics which are discussed in the notes are given below:
- Important Multiple Choice Questions of 2nd year computer chapter 14 mcqs of 2nd-year Computer Science.
- Q1: A __ is a set of related records: (a) Language (b) Function (c) File (d) Program
- Q2: A file is stored in: (a) RAM (b) ROM (c) Hard disk (d) Cache
- Q3: There are following types of streams: (a) 1 (b) 2 (c) 3 (d) 4
- Q4: In File handing sequence of bytes is called: (a) Text stream (b) File stream (c) Binary steam (d) Character stream
- Q5: A logical interface to a file is called: (a) I/O (b) FILE I/O (c) Stream (d) Pointer
- Important 2nd year computer chapter 14 mcqs with answers for Intermediate part-II students.
- Q6: Text stream have following correspondence with characters:
- (a) One to one (b) One to many (c) Many to one (d) All of these
- Q7: A __ can store text only: (a) Binary file (b) Text file (c) Exe file (d) Object file
- Q8: To mention end of file point , following marker is used:
- (a) File End ( FE ) (b) End File ( EF ) (c) End of File ( EF ) (d) End of File ( EOF )
- Q9: A text file is a ___ collection of characters: (a) Fresh (b) Old (c) Named (d) New
- Q10: If fptr = fopen ("afile.txt" , "r" ) statement is used to open a file then what would be the
necessary condition ?: (a) The file must already exist (b) The file must contain valid student data (c) The file should be data file only (d) The type of file must be read only
- Q11: Fopen ( ) function takes ___ parameters: (a) 1 (b) 2 (c) 3 (d) 4
- Important 2nd year computer chapter 14 important mcqs for Intermediate part-II students.
- Q12: To open a file following function is used: (a) Open ( ) (b) File open ( ) (c) Fopen ( ) (d) Getc ( )
- Q13: In the absolute path of a file we use: (a) \ (b) / (c) \\ (d) //
- Q14: Which mode opens only an existing file for both reading and writing?
- (a) "w" (b) "w+" (c) "r+" (d) "a+"
- Q15: In the statement FILE * fp ; the * denotes: (a) Pointer (b) Variable (c) Multiplication (d) Parameter
- Q16: A file can be closed using following function: (a) close ( ) (b) fclose ( ) (c) file close ( ) (d) exit ( )
- Important 2nd year computer chapter 14 short questions for Intermediate part-II students.
- What is a data file?: Ans: A data file is a collection of related records. A record is a collection of fields. Any type of
data can be stored in data files. Data in data files is stored permanently.
- What is a stream?
- Important 2nd year computer chapter 14 important long questions for Intermediate part-II students.
- What are the different types of streams?
- What is a text stream?
- What is a binary stream?
- What is an input stream?
- What is an output stream?
- What is a pointer?
- What is a file pointer?
- What is getche() function?
- Important 2nd year computer chapter 14 long questions for Intermediate part-II students.
- What is a string?: Ans: A collection of character enclosed in double quotations is called a string. The variable that
is used to store a string is called string variable. C language does not provide any special
data type to store string. As string is a combination of characters, a char array is used to
store string.
- What is the purpose of fopen() function?
- What is the purpose of fputs() function?
- What is the purpose of fgets() function?
- What is the purpose of putc() function.
- What is the purpose of getc() function.
- What is the purpose of fprintf() function.
- What is the purpose of fscanf() function.
- Important 2nd year computer chapter 14 long questions pdf download for Intermediate part-II students.
- What is the purpose of fclose() function: Ans: When a file is open it is transferred from secondary storage to main memory. A
connection is established between C program and file with the help of file pointer. When a
file is closed its contents are transferred from main memory to secondary storage. Its
connection with C program breaks. File pointer is destroyed and data of file becomes
inaccessible. If a file is not closed properly some data may lose. The function fclose( ) is
used to close a file opened by fopen( ) function.