Computer Programming Mid - II, March - 2015

1.The function that is invoked is known as _____________ function.
  • calling
  • called
  • caller
  • invoking
Answer: B
2.The default storage class of local variables is ___________.
  • auto
  • static
  • register
  • extern
Answer: A
3.What is the default return type if it is not specified in function definition?
  • void
  • int
  • double
  • float
Answer: B
4.The function that returns the absolute value of a long integer is _________.
  • abs( )
  • dabs( )
  • fabs( )
  • labs( )
Answer: D
5.Array elements are stored in __________ memory locations.
  • direct
  • scattered
  • sequential
  • random
Answer: C
6.The ___________ operator makes a pointer value from a pointer constant to get the address of a variable.
  • &
  • .
  • *
  • -->
Answer: A
7.Address stored in the pointer variable is of type __________.
  • void
  • char
  • int
  • float
Answer: C
8.Which of the following memory allocation function in C allocates a block of memory that contains the number of bytes specified in its parameter?
  • alloc( )
  • calloc( )
  • realloc( )
  • malloc( )
Answer: D
9.For declaring pointer to a two-dimensional int array which of the following codes are correct?
  • int **(n);
  • int (*ptr) [n];
  • int * [n];
  • int ptr* [n];
Answer: B
10.Which of the following is not a function to read a string?
  • gets( )
  • scanf( )
  • getchar( )
  • getstr( )
Answer: D
11.Recursive functions are implemented using __________.
Answer: system stack
12.Each C program must have one and only function called ___________.
Answer: main( )
13.All preprocessor commands start with a ___________ sign.
Answer: #(pound)
14.The elements of one array cannot be copied into another by using __________.
Answer: assignment operator/statement
15.A ____________ is a pictorial representation of a frequency array.
Answer: histogram
16.An array of pointers that can be used to save space when not all rows of the array are full is called _______________ array.
Answer: ragged array
17.A ___________ is a derived data type consisting of addresses available in the computer.
Answer: pointer
18.The string function that returns the number of characters in the string excluding the NULL character is ___________.
Answer: strlen( )
19.The __________ character is used as an end-of-string marker.
Answer: NULL
20.The string manipulation function that copies the contents of one string to another is _____________.
Answer: strcpy( )