C/C /C Multiple Choice Questions Sample Test,Sample questions

Question:
 FILE reserved word is?

1.A structure tag declared in stdio.h

2.One of the basic datatypes in c

3.Pointer to the structure defined in stdio.h

4.It is a type name defined in stdio.h


Question:
 stdout, stdin and stderr are?

1.File pointer

2.File desciptors

3. Streams

4.Structure


Question:
 What is the meant by 'a' in the following operation?
fp = fopen("Random.txt, "a);

1.Attach

2.Append

3.Apprehend

4.Add


Question:
 Which type of files can't be opened using fopen()?

1.txt

2.bin

3.c

4.None of the mentioned


Question:
If there is any error while opening a file, fopen will return?

1.Nothing

2.EOF

3.NULLD.

4.Depends on compiler


Question:
The first and second arguments of fopen are?

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

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

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

4.None of the mentioned of the mentioned.


Question:
What does the following segment of code do?
fprintf(fp, "Copying!);

1.It writes Copying!" into the file pointed by fp

2.It reads Copying!" from the file and prints on display

3.It writes as well as reads Copying!" to and from the file and prints it

4.None of the mentioned


Question:
What is the meant by 'a' in the following operation?
fp = fopen("Random.txt, "a);

1.Attach

2.Append

3.Apprehend

4.Add


Question:
Which is true about getc.getc returns?

1.The next character from the stream referred to by file pointer

2.EOF for end of file or error

3.Both a & b

4.Nothing


Question:
Which of the following fopen statements are illegal?

1. fp = fopen(abc.txt", r");

2.fp = fopen(/home/user1/abc.txt", w");

3.fp = fopen(abc", w");

4.None of the mentioned


Question:
Which of the following mode argument is used to truncate?

1.a

2.f

3.w

4.t


More MCQS

  1. C++ Programming MCQS Set-1
  2. C++ Multiple Choice Questions Set-1
  3. C++ Multiple Choice Questions Set-2
  4. C++ Programming MCQS Set-2
  5. C++ Programming MCQS Set-3
  6. C++ Programming MCQS Set-4
  7. C++ (CPP) MCQ Question with Answer
  8. Advanced c++ multiple choice question(MCQS)
  9. OOPS Quiz Questions and Answers(MCQS)
  10. C Programming - MCQ Questions Set 1
  11. C Programming - MCQ Questions Set 2
  12. C Programming - MCQ Questions Set 3
  13. C Programming - MCQ Questions Set 4
  14. C Programming - MCQ Questions Set 5
  15. C++ programming language MCQ Questions Set 1
  16. C++ programming language MCQ Questions Set 2
  17. C++ programming language MCQ Questions Set 3
  18. C++ programming language MCQ Questions Set 4
  19. C++ programming language MCQ Questions Set 5
  20. C++ Programming -Constructors and Destructors
  21. C++ Programming -OOPS Concepts
  22. C++ Programming - References
  23. C++ Programming - Functions
  24. C MCQS:-The ABC of C
  25. C MCQS Interview Questions
  26. C++ Questions and Answers – OOPs Basic Concepts
  27. C++ Questions and Answers – Returning Objects
  28. C Programming MCQ Part 1
  29. C Programming MCQ
  30. Computer Science & Engineering C Multiple Choice Questions set 1
  31. Computer Science & Engineering C Multiple Choice Questions set 2
  32. C Multiple Choice Questions C Functions Set 1
  33. C Multiple Choice Questions C Functions Set 2
  34. C Multiple Choice Questions C Operators
  35. C Multiple Choice Questions & AnswersConditional Expressions
  36. C Multiple Choice Questions & Answers Data Types
  37. C Multiple Choice Questions & Answers File Access
  38. Computer Science & Engineering Cloud Computing MCQs Part 1
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!