Basic C Programming MCQ Questions and Answers

Practice Mode
Showing 10 of 198 questions
Q161
C preprocessor
  • A takes care of conditional compilation
  • B takes care of macros
  • C takes care of include files
  • D acts before compilation
Answer: Option
Q162
A preprocessor command
  • A need not start on a new line
  • B need not start on the first column
  • C has # as the first character
  • D comes before the first executable statement
Answer: Option C
Q163
Choose the correct statement.
  • A The scope of macro definition need not be the entire program.
  • B the scope of a macro definition extends from the point of definition to the end of the file.
  • C New line is macro definition delimiter.
  • D A macro definition may go beyond a line.
Answer: Option
Q164
The use of macro in the place of functions
  • A reduces execution time
  • B reduces code size
  • C increases execution time
  • D increase code size
Answer: Option
Q165
The process of transforming one bit pattern into another by bit-wise operations is called
  • A masking
  • B pruning
  • C biting
  • D chopping
Answer: Option A
Q166
The operation of a staircase switch best explains the
  • A or operation
  • B and operation
  • C exclusive nor operation
  • D exclusive or operation
Answer: Option D
Q167
a << 1 is equivalent to
  • A multiplying a by 2
  • B dividing a by 2
  • C adding 2 to a
  • D none of the above
Answer: Option D
Q168
The most significant bit will be lost in which of the following operations ?
  • A >>
  • B complementation
  • C >>
  • D none of the above
Answer: Option A
Q169
Assume an unsigned integer occupies 1 byte. Let myVar be an unsigned integer. then myVar << 1 multiplies myVar by 2 if it is not greater than
  • A 127
  • B 255
  • C 256
  • D 128
Answer: Option A
Q170
If the bit pattern corresponding to a signed integer is shifted to the right then
  • A vacant bit will be filled by the sign bit
  • B vacant bit will be filled by 0
  • C the outcome is implementation dependent
  • D none of the above
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test