Basic C Programming MCQ

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