Variable and Comment in C MCQs Exercise II


Ques 1 Variable and Comment


Which of the following is not a technique of dynamic memory allocations in C Programming?
  a) dmalloc()
  b) realloc()
  c) calloc()
  d) malloc()


a is the correct option





Ques 2 Variable and Comment


What is the purpose of comments in C programming?
  a) To execute specific code blocks
  b) To provide documentation and explanations
  c) To declare variables
  d) To print output


b is the correct option





Ques 3 Variable and Comment


What happens if you declare a variable but do not initialize it in C?
  a) The program crashes
  b) The variable automatically gets a default value
  c) The variable remains uninitialized
  d) The compiler gives an error


c is the correct option





Ques 4 Variable and Comment


What is the purpose of comments in C programming?
  a) To execute specific code blocks
  b) To provide documentation and explanations
  c) To declare variables
  d) To print output


b is the correct option





Ques 5 Variable and Comment


Which of the following statements about comments in C is true?
  a) Comments are executed by the compiler.
  b) Comments are ignored by the compiler.
  c) Comments are necessary for the program to compile.
  d) Comments can only be used at the beginning of a program.


b is the correct option