Basic C Programming MCQ Questions and Answers

Take Exam

Basic C Programming MCQ questions with answers help candidates master the fundamentals of C language — one of the most popular programming languages for beginners and interview aspirants. These programming questions and answers focus on syntax, operators, loops, functions, and data handling. Practicing C programming MCQs strengthens logic and helps students perform better in technical assessments by TCS, Infosys, HCL, and other top recruiters. Each question is designed to test conceptual understanding and problem-solving skills, making it ideal for both practice and revision before coding interviews or placement exams.

Basic C Programming MCQ

Showing 10 of 198 questions

141. If a file is opened in w+ mode then

  • appending is possible
  • reading is possible
  • writing is possible
  • after write operation reading is possible without closing and re-opening
Show Answer Report

142. The fseek function

  • needs 2 argumentsd
  • makes the rewind function unnecessary
  • is meant for checking whether a given file exists or not
  • needs 3 arguments
Show Answer Report

143. The statement fseek (fp, 0L, 0); - if syntactically correct, means

  • fp is a file pointer
  • position the read-write-head at the start of the file
  • position the read-write-head at the end of the file
  • erase the contents of the file
Show Answer Report

144. The contents of a file will be lost if it is opened in

  • a mode
  • w mode
  • w+ mode
  • a+ mode
Show Answer Report

145. Which of the following comments about union are true?

  • Union is a structure whose members share the same storage area
  • the compiler will keep track of what type of information is currently stored.
  • Only one of the members of union can be assigned a value at a particular time.
  • Size allocated for union jis the size of its member needing the maximum storage.
Show Answer Report

146. Which of the following comments about the usage of structure is true?

  • Storage class can be assigned to an individual member.
  • Individual members can be initialized within a structure type declaration.
  • the scope of a member name is confined to the particular structure, within which it is defined.
  • None of the above.
Show Answer Report

147. sex can be accessed by

  • criminal. sex
  • kd ---> sex
  • (*kd). sex
  • either (a) or (c), but not by (b)
Show Answer Report

148. pincode can be accessed by

  • criminal . locate. pincode
  • criminal. pincode
  • kd ---> locate. pincode
  • kd.locate ---> pincode
Show Answer Report

149. The third character in the criminal name can be accessed by

  • criminal.name [2]
  • kd ----> name [2]
  • ((*kd . name([2]
  • either (b) or (c), but not by (a)
Show Answer Report

150. * (kd ----> name + 2) can be used instead of

  • * (criminal. name +2)
  • kd ----> (name + 2)
  • * ((*kd). name + 2)
  • either (a) or (b), but not (c)
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test