Basic C Programming MCQ Questions and Answers
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
171. If the word size is 16 bit, then ~0xc5 will be
- 0x3a
- 0xff3a
- 0x5c
- none of the above
172. Preprocessing is typically done
- either before or at the beginning of the compilation process
- after compilation but before execution
- after loading
- none of the above
173. Which of the following comments about the preprocessor directive # are correct ?
- It converts the formal argument in the macro definition into a string.
- It strips out redundant blanks
- It concatenates adjacent strings, if any.
- None of the above
174. The scope of a macro definition
- cannot be beyond the file in which it is defined
- may be part of a file
- is the entire program
- excludes string of characters within double quotes
175. Thu number of possible values of m, such that m & 0x3f equals 0x23 is
- 1
- 2
- 3
- 4
176. As soon as a pointer variable is freed, its value
- is set to null
- becomes unpredictable
- is set to 1
- remains the same
177. calloc(m , n); is equivalent to
- malloc(m *n, 0);
- memset(0, m*n);
- ptr = malloc(m*n); memset(p. o, m*n);
- ptr = malloc(m*n); strcpy(p, u);
178. Which of the following comments are correct when a marco definition includes argumentsd ?
- The opening parenthesis should immediately follow the macro name.
- There should be at least one blank between the macro name and the opening parenthesis
- There should be only one blank between the marco name and the opening parenthesis.
- All the above comments are correct.
179. Choose the correct statements.
- ' x ' is same as " x "
- Lengthf of the string " x " is two
- Unless otherwise specified, the first name in an enum has the value 1.
- None of the above
180. Choose the correct statements.
- enum variables can be assigned new values.
- enum variables can be eompared.
- Enumeration feature does not increase the power of C.
- Use of enumeration enhances the logical clarity of a program.