Punjab 12th Class Computer Chapter 7 File Management Mcqs Test Online Punjab 12th Class Computer Chapter 7 File Management Mcqs Test Online 1234567891011121314151617181920Show paginator Hide paginator Question 1 of 20Computer Science 1. File manipulation functions in C are available in which header file? 1.Streams.h 2.Files.h3.Stdio.h 4.Stdlib.h Question 1 of 20Question 2 of 20 2. For reading strings from a file we use the function ________. 1.Fputs() 2.Fopens() 3.Fgets() 4.Fprintf()Question 2 of 20Question 3 of 20 3. A file opened with fopen() will thereafter be referred by its ____________. 1.Fclose()2.Variable 3.Getc() 4.Fprintf() Question 3 of 20Question 4 of 20 4. Which statement defines the file structure? 1.FILE *fptr; 2.OPENFILE *fptr:3.FILE*fptr: 4.OPENFILE*fptr; Question 4 of 20Question 5 of 20 5. To write a character to the file we use function __________. 1.Putc() 2.Writec() 3.Write() 4.Putp() Question 5 of 20Question 6 of 20 6. Function fgets() takes __________ parameters. 1.Three 2.Two 3.Four 4.Five Question 6 of 20Question 7 of 20 7. What statement is used to add a newline character to the end of the line? 1.Fputs(“\n”,fptr); 2.Fputs(“\I”,fptr);3.Fgets(“\n”,fptr); 4.Printf(“\n”,fptr); Question 7 of 20Question 8 of 20 8. We use the function ________ to read data from a file. 1.Inputc() 2.Getchararacter() 3.Getc() 4.Inputchar()Question 8 of 20Question 9 of 20 9. The function used for formatted output and input. 1.Fprint f ( ) 2.a and b both 3.None of these4.Fscan f ( ) Question 9 of 20Question 10 of 20 10. When we have finished writing to the file, we use the statement __________. 1.Fleclose(fptr); 2.Fclosed(fileptr); 3.Fclose(fptr); 4.Fileclose(fileptr); Question 10 of 20Question 11 of 20 11. ___________ message tells that the file is not opened. 1.NULL 2.NU3.NULLFILE 4.NOTOPEN Question 11 of 20Question 12 of 20 12. When the operating system realize that the last character in a file has been sent it transmits the __________. 1.End signal 2.-2 signal 3.EOF signal 4.EFO signal Question 12 of 20Question 13 of 20 13. A _________ is a collection of bytes that is given a name. 1.None of these2.Language 3.File 4.Character Question 13 of 20Question 14 of 20 14. NULL is equivalent to a value of __________. 1.1 2.2 3.6 4.0 Question 14 of 20Question 15 of 20 15. fscanf() function used to read the data is very similar to the function ____________. 1.Scastr()2.Fprintf() 3.Printf() 4.Scanf() Question 15 of 20Question 16 of 20 16. What is the usage of putc() function? 1.It is used to print a character on screen 2.It is used to read a character on screen 3.It is used to print a character to the printer 4.It is used to write a character to a file Question 16 of 20Question 17 of 20 17. To write strings to a file, we use the function ___________. 1.Fputs() 2.Fopen() 3.Getch() 4.Putc() Question 17 of 20Question 18 of 20 18. In the C language input/output operations on disks are performed using entities called _________. 1.Data 2.Files 3.Directories 4.Functions Question 18 of 20Question 19 of 20 19. Which statement open the file in both reading and writing mode? 1.fptr=fopen(“test.txt”,”w”); 2.fptr=fopen(“test.txt”,”r+”); 3.fptr=fopen(“test.txt”,”r-”);4.fptr=fopen(“test.txt”,”a+”); Question 19 of 20Question 20 of 20 20. What does the statement “fprintf(fptr, “%s %d %f”, name, weight, height); “will do? 1.Print the values of three variables to the screen 2.Writes the values of three variables to the printer 3.Read the values of three variables from the file.4.Writes the values of three variables to the file Question 20 of 20 Loading... Test By Subject Punjab Test By Topics 12th Class Computer You Can Learn and Gain more Knowledge through our Online Quiz and Testing system Just Search your desired Preparation subject at Gotest.