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

51. In a for loop, if the condition is missing, then infinite looping can be avoided by a

  • continue statement
  • goto statement
  • return statement
  • break statement
Show Answer Report

52. Choose the correct statement.

  • 0 represents a false condition
  • Non-zero value represents a false condition
  • 1 represents a false condition
  • Anything that is not 1, represents a false condition
Show Answer Report

53. Which of the following comments about for loop are correct ?

  • Index value is retained outside the loop
  • Index value can be changed ffrom within the loop
  • goto can be used to jump, out of loop
  • Body of the loop can be empty.
Show Answer Report

54. Which of the following comments about for loop are correct ?

  • Using break is equivalent to using a goto that jumps to the statement immediately following the loop.
  • Continue is used to by-pass the remainder of the current pass of the loop.
  • If comma operator is used, then the value returned is the value of the right operand.
  • It can always be replaced by a while loop.
Show Answer Report

55. Choose the correct answers.

  • for loops can be nested
  • Nested for loop can't use the same index variable
  • Nested for loop can't overlap
  • None of the above
Show Answer Report

56. Consider the following program fragment if (a > b) if (b > c) s1; else s2; s2 will be executed if

  • a <=b
  • b > c
  • b <=c and a <=b
  • a >b and b<=c
Show Answer Report

57. If switch feature is used, then

  • default case must be present
  • default case, if used, should be the last case
  • default case, if used, can be placed anywhere
  • none of the above
Show Answer Report

58. The switch feature

  • can always be replaced by a nested if-then-else clause
  • enhances logical clarity
  • can't always be replaced by a nested if-then-else clause
  • none of the above
Show Answer Report

59. Break statement can be simulated by using

  • goto
  • return
  • exit
  • any of the above features
Show Answer Report

60. The following program fragment if (2 < 1) ; else x = (2 < 0) ? printf ("one") : printf ("four"); printf ("%d), x);

  • prints nothing
  • results in a syntax error
  • prints four0
  • none of the above
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test