Basic C Programming MCQ Questions and Answers

Practice Mode
Showing 10 of 198 questions
Q81
The following program main () { static char a[3][4] = {"abcd", "mnop", "fghi"}; putchar (**a); }
  • A will not compile successfully
  • B results in run-time error
  • C prints garbage
  • D none of the above
Answer: Option D
Q82
C does no automatic array bound checking. This is
  • A true
  • B false
  • C C's asset
  • D C's shorting
Answer: Option
Q83
printf ("%10.5s", wer); outputs
  • A NO SU
  • B NO SUBSTIT
  • C NO SU
  • D UTE F
Answer: Option C
Q84
printf ("%-10.s", wer); outputs
  • A NO SU
  • B NO SUBSTIT
  • C NO SU
  • D UTE F
Answer: Option C
Q85
printf ("%-10.*s", hh, wer); outputs
  • A NO SU
  • B NO SUBSTITUTE FO
  • C NO SU
  • D error message
Answer: Option B
Q86
If n has the value 3, then the statement a[++n] = n++;
  • A assigns 3 to a [5]
  • B assign 4 to a[5]
  • C assign 4 to a[4]
  • D what is assigned is compiler-dependent
Answer: Option D
Q87
Choose the statement that best defines an array
  • A It is a collection of items that share a common name.
  • B It is a collection of items that share a common name and occupy consecutive memory locations.
  • C It is collection of items of the same type and storage class that share a common name and occupy consecutive memory locations.
  • D none of the above
Answer: Option C
Q88
Choose the correct statements.
  • A Strictly speaking C support 1-dimensional arrays only.
  • B An array element may be an array by itself.
  • C Array elements need not occupy contiguous memory locations.
  • D None of the above
Answer: Option
Q89
The order in which actual arguments are evaluated in a function call
  • A is from the left
  • B is from the right
  • C is compiler-dependent
  • D none of the above
Answer: Option C
Q90
If a global variable is of storage class static, then
  • A the static declaration is unnecessary if the entire source code is in a single file
  • B the variable is recognized only in the file in which is defined
  • C it results in a syntax error
  • D none of the above
Answer: Option
Questions and Answers for Competitive Exams Various Entrance Test