C - Files and Preprocessors Questions and Answers

Take Exam

C Files and Preprocessors Questions with Answers are essential for mastering file handling, macros, and directives in C programming. As part of programming questions and answers for placement exams, this topic helps students understand real-world input/output operations and code optimization techniques. Frequently asked in TCS, Wipro, and Capgemini tests, these questions assess how well you manage data files and preprocess instructions efficiently. Practicing these C programming MCQs with solutions improves your coding proficiency and exam accuracy. Access free C file handling and preprocessor aptitude questions with explanations in PDF or attempt our online mock test.

C - Files and Preprocessors

Showing 10 of 96 questions

31. The function used for reading binary stream is

  • read ( )
  • fread ( )
  • fscanf ( )
  • all the above
Show Answer Report

32. Identify the functions for in-memory for mat conversions

  • realloc ( )
  • sprintf ( )
  • sscanf( )
  • both options b and c
Show Answer Report

33. The value of string after  exeecuting the following statements is int x = 25; char string [5]; sprintf ( string, "%d", x);

  • "25"
  • 25
  • TWO FIVE
  • 25000
Show Answer Report

34. The value of ch after executing the following statements is int x; char ch; char string [20] = "100 5"; sscanf (string, "%3d%d", &x, &ch);

  • 5
  • blank
  • "5"
  • NULL
Show Answer Report

35. Identify the correct statement.

  • # include "filename"
  • #include <filename>
  • both options a and b
  • #include filename
Show Answer Report

36. The following line in a program # represents

  • an invalid code
  • a null dirrective
  • a comment
  • a page number
Show Answer Report

37. Macros

  • can be recursively defined
  • cannot be recursively defined
  • cannot be defined
  • are not preprocessor facility
Show Answer Report

38. Identify the stringzing operator.

  • a+
  • ::
  • #
  • ##
Show Answer Report

39. idenfity the token pasting operator

  • +
  • ++
  • #
  • ##
Show Answer Report

40. The directive (s) used in conditional compilation is (are)

  • #if
  • #elif
  • #else
  • all the above
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test