Basic C Programming MCQ

Basic C Programming MCQ
131. Let x be an array. which of the following operations are illegal ?
  • ++x
  • x + 1
  • x++
  • x * 2
Show Answer
132. If func is a function needing three arguments a1, a2, a3, then func can be invoked by
  • func(a1, a2, a3);
  • (*func) (a1, a2, a3);
  • *func(a1,. a2, a3);
  • all of the above
Show Answer
133. The declaration int (*p) [5]; means
  • p is a one dimensional array of size 5, of pointers to integers
  • p is a pointer to a 5 element integer array
  • the same as int *p[5]
  • none of the above
Show Answer
134. A function q that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as
  • int (*q(char*))[]
  • int *q(char *)[]
  • int (*q) (char *) []
  • none of the above
Show Answer
135. In the previous question, printf ("%d", a**b); prints
  • 25
  • garbage
  • 0
  • an error message
Show Answer
136. Choose the correct statements.
  • Array stores data of the same type
  • Array can be a part of a structure
  • Array of structure is allowed
  • Structure stores data of the same type
Show Answer
137. a ----> b is syntactically correct if
  • a and b are structures
  • a is a structure and b is a pointer to a structure
  • a is a pointer to a structure and b is a structure
  • a is a pointer to structure in which b is a field
Show Answer
138. A file is preferable to an array of structures because
  • file lives even after the program that created it terminates
  • memory space will not be wasted
  • there are many system tools to manipulate files
  • there are language as well as system features to deal with files
Show Answer
139. If a file is opened in r+ mode then
  • reading is possible
  • writing is possible
  • it will be created if it does not exist
  • all the above comments are true
Show Answer
140. ftell
  • is a function
  • gives the current file position indicator
  • can be used to find the size of a file
  • is meant for cheeking whether a given file exists or not
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test