Basic C Programming MCQ Questions and Answers

Practice Mode
Showing 10 of 198 questions
Q131
Let x be an array. which of the following operations are illegal ?
  • A ++x
  • B x + 1
  • C x++
  • D x * 2
Answer: Option
Q132
If func is a function needing three arguments a1, a2, a3, then func can be invoked by
  • A func(a1, a2, a3);
  • B (*func) (a1, a2, a3);
  • C *func(a1,. a2, a3);
  • D all of the above
Answer: Option
Q133
The declaration int (*p) [5]; means
  • A p is a one dimensional array of size 5, of pointers to integers
  • B p is a pointer to a 5 element integer array
  • C the same as int *p[5]
  • D none of the above
Answer: Option B
Q134
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
  • A int (*q(char*))[]
  • B int *q(char *)[]
  • C int (*q) (char *) []
  • D none of the above
Answer: Option A
Q135
In the previous question, printf ("%d", a**b); prints
  • A 25
  • B garbage
  • C 0
  • D an error message
Answer: Option A
Q136
Choose the correct statements.
  • A Array stores data of the same type
  • B Array can be a part of a structure
  • C Array of structure is allowed
  • D Structure stores data of the same type
Answer: Option
Q137
a ----> b is syntactically correct if
  • A a and b are structures
  • B a is a structure and b is a pointer to a structure
  • C a is a pointer to a structure and b is a structure
  • D a is a pointer to structure in which b is a field
Answer: Option D
Q138
A file is preferable to an array of structures because
  • A file lives even after the program that created it terminates
  • B memory space will not be wasted
  • C there are many system tools to manipulate files
  • D there are language as well as system features to deal with files
Answer: Option
Q139
If a file is opened in r+ mode then
  • A reading is possible
  • B writing is possible
  • C it will be created if it does not exist
  • D all the above comments are true
Answer: Option
Q140
ftell
  • A is a function
  • B gives the current file position indicator
  • C can be used to find the size of a file
  • D is meant for cheeking whether a given file exists or not
Answer: Option
Questions and Answers for Competitive Exams Various Entrance Test