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

1. Choose the correct statement.

  • Use off goto enhence the logical clarity of a code
  • Use of goto makes the debugging task easier
  • Use goto when you want to jump out of a nested loop
  • Never use goto
Show Answer Report

2. Which is true of conditional compilation ?

  • It is taken care of by the compiler
  • It is setting the compiler option conditionally
  • It is compling a program based on a condition.
  • It is taken care of by the pre-processor
Show Answer Report

3. C was primarily developed as a

  • systems programming language
  • general purpose language
  • data processing language
  • none of the above
Show Answer Report

4. C is a

  • high level language
  • low level language
  • high level language with some low level features
  • low level language with some high level features
Show Answer Report

5. Even if a particular implementation doesn't limit the number of characters in an identifier, it is advisable to be concise because

  • chance of typographic errors are less
  • it may be processed by assembler, loaders, etc., which may have their own rules thalt may contradict the language rule
  • by being concise, one can be mnemonoc
  • none of the above
Show Answer Report

6. The minimum number of temporary variables needed to swap the contents of two variables is

  • 1
  • 2
  • 3
  • 0
Show Answer Report

7. The purpose of the following program fragment b = s + b; s = b - s; b = b - s; where s,b are two integers is to

  • transfer the contents of s to b
  • transfer the contents of b to s
  • exchange (swap) the contents of s and b
  • negate the contents of s and b
Show Answer Report

8. Consider the function find (int x, into y) {return (( x < y 7 0 : ( x - y));} Let a, b be two non-negative integers. the call find ( a, find (a, b) can be used to find the

  • mximum of a, b
  • positive difference of a, b
  • sum of a, b
  • minimum of a, b
Show Answer Report

9. Let a, b be two non-negative integers. Which of the following calls, finds the positive difference of a and b?

  • find (a,b) + find (b,a)
  • find (a,find(a,b))
  • a + find (a,b)
  • b + find(a,b)
Show Answer Report

10. If abc is the input, then the following program fragment char x, y, z; print f("%d", scanf ("%c%c", &x, &y, &z)); results in

  • a syntax error
  • a fatal error
  • segmentation violation
  • printing of 3
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test