Basic C Programming MCQ Questions and Answers

Practice Mode
Showing 10 of 198 questions
Q181
For the previous question, which of the following macro-calls, will find the hypotenuse of a right angled triangle with sides a + 1 AND B + 1 ?
  • A log (n) + 1
  • B log (n - 1) + 1
  • C log (n + 1) + 1
  • D none of the above
Answer: Option A
Q182
The statement printf ("%d", 10?0?25:11:12); prints
  • A 10
  • B 0
  • C 12
  • D 11
Answer: Option D
Q183
The statement printf ("%d", (a++)); prints
  • A the current value of a
  • B the value of a + 1
  • C an error message
  • D garbage
Answer: Option A
Q184
The statement printf ("%", ++5); prints
  • A 5
  • B 6
  • C an error message
  • D garbage
Answer: Option C
Q185
The statement printf ("%d", size of (" ")) ; prints
  • A an error message
  • B 0
  • C garbage
  • D 1
Answer: Option D
Q186
If p is a pointer to an integer an t is a pointer to a character then size of (p) will be
  • A same as that sizeof (t)
  • B greater than that of sizeof (t)
  • C less than that sizeof (t)
  • D none of the above
Answer: Option A
Q187
Which of the following comments about arrays and pointers is/are not true ?
  • A Both are exactly same
  • B Array is a constant pointer
  • C Pointer is an one-dimensional array
  • D Pointer is a dynamic array
Answer: Option
Q188
lint is
  • A a C compiler
  • B an inter-active debugger
  • C a C interpreter
  • D a tool for analyzing a C program
Answer: Option D
Q189
cb is a
  • A C code beautifying tool
  • B C interpreter
  • C C compiler
  • D none of the above
Answer: Option A
Q190
It is not advisable to use macros instead of functions because
  • A it increase the code size
  • B no type checking will be done
  • C recursion is not possible
  • D pointers cannot be used with macro identifiers
Answer: Option
Questions and Answers for Competitive Exams Various Entrance Test