Online Test for C

  1. perror( ) function used to ?
    Work same as printf()
    prints the error message specified by the compiler
    prints the garbage value assigned by the compiler
    None of the above

  1. What is Dequeue?
    Elements can be added from front
    Elements can be added to or removed from either the front or rear
    Elements can be added from rear
    None of the above


  1. A file opened for writing already exists its contents would be overwritten.
    True
    False

  1. #define is known as preprocessor compiler directive.
    True
    False

  1. The keywords cannot be used as variable names.
    True
    False

  1. Which one of the following in-place sorting algorithms needs the minimum number of swaps?
    Insertion Sort
    Quick Sort
    Heap Sort
    Selection Sort


  1. Which of the following is allowed in a C Arithmetic instruction
    []
    {}
    ()
    None of the above

  1. Why we use malloc and calloc for
    Dynamic memory allocation
    Static memory allocation
    Both dynamic and static memory allocation
    None of the above

  1. The correct way to round off a floating number x to an integer value is
    y = int (x + 0.5)
    y = (int) (x + 0.5)
    y = (int) x + 0.5
    y = (int) ((int)x + 0.5)

  1. An array elements are always stored in _________ memory locations.
    Sequential
    Random
    Sequential and Random
    None of the above

Post Your Question
Social Sharing
Search