Online Test for C

  1. Which of the following sorting algorithms does NOT have a worst-case running time of O(n2)?
    Insertion sort
    Merge sort
    Quicksort
    Bubble sort

  1. Only character or integer can be used in switch statement
    True
    False


  1. What is the right way to access value of structure variable book{ price, page }?
    printf("%d%d", book.price, book.page);
    printf("%d%d", price.book, page.book);
    printf("%d%d", price::book, page::book);
    printf("%d%d", price->book, page->book);

  1. The best data structure to check whether an arithmetic expression has balanced parenthesis is a
    Queue
    Stack
    Tree
    List

  1. Which of the following is NOT a valid Integer Constant?
    3
    +343
    -765
    10,000

  1. Bitwise operators can operate upon?
    double and chars
    floats and doubles
    ints and floats
    ints and chars


  1. Which is the correct syntax to declare constant pointer?
    int *const constPtr;
    *int constant constPtr;
    const int *constPtr;
    A and C both

  1. What is variable in C?
    It is a name of the memory location
    It is used to store data
    It’s value can be changed during execution of program
    All of the above

  1. Which one of the following is not a linear data structure?
    Array
    Binary Tree
    Queue
    Stack

  1. The keywords are also called
    Safe words
    Static words
    Reserved words
    Reused words

Post Your Question
Social Sharing
Search