Basic C Programming MCQ

Basic C Programming MCQ
91. Which of the following statements are correct ?
  • It is possible for a function to access a variable that is local to another function
  • Two local variables may have the same name
  • The scope of a local variable should be a function
  • The scope of a local variable may be a single statement.
Show Answer
92. The default parameter passing mechanism is
  • call by value
  • call by reference
  • call by value result
  • none of the above
Show Answer
93. Choose the correct statements.
  • During external variable definition, storage is set aside by the compiler
  • During external variable declaration, no storage is set aside by the compiler
  • The use of external variables may make debugging difficult
  • None of the above
Show Answer
94. The storage class static can be used to
  • restrict the scope of an external identifier
  • preserve the exit value of variables
  • provide privacy to a set of functions
  • none of the above
Show Answer
95. The following program main() {printf ("tim"); main ();}
  • is illegal
  • keeps on printing tim
  • prints tim once
  • none of the above
Show Answer
96. Consider the following program main() { putchar ('M'); first (); putchar ('m');} first () { _______ } second() { putchar ('d');} If madam is the required output, then the body of first () must be
  • empty
  • second(); putchar ('a');
  • putchar ('a'); second (); printf ("%c", 'a')'
  • none of the above
Show Answer
97. Use of functions
  • helps to avoid drepeating a set of statements many times
  • enhances the logical clarity of the program
  • helps to avoid repeated programming across programs
  • makes the debugging task easier
Show Answer
98. Which of the following comments about wide character is/are true ?
  • It is the binary representation of a character in the extended binary set.
  • It is of intege type wchar_t
  • End of file is represented by WEOF.
  • None of the above
Show Answer
99. Pick the correct statements.
  • The body of a function should have only one returnf statement.
  • The body of a function may have many return statements.
  • A function can return only one value to the calling environment
  • If return statement is omitted, then the function does itsd job but returns no value to the calling environment.
Show Answer
100. max is a function that returns the larger of the two integers, given as arguments. Which of the following statements finds the largest of three given numbers ?
  • max (max (a, b), max (a, c))
  • max (a, max (a, c))
  • max (max (a, b ), max (b, c))
  • max (b, max (a, c))
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test