Online Test for C

  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 valid commenting style in C?
    /* comment */
    // comment
    /* Comment line 1 <br> Comment line 2 */
    All of the above


  1. Find Error/Output in follwing code:
  2.                                 
    void main ()
    
    {
      int x = 128;
      printf ("n%d", 1 + x++);
    }
    128
    129
    130
    131

  1. Type of data and its value is described dy
    Constants
    Variables
    Data Type
    None of the above

  1. What is the purpose of getc()?
    read a character from STDIN
    read a character from a file
    read all file
    read file randomly

  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. Blank spaces may be inserted between two words to improve the readability of the statement.
    True
    False

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

  1. The _______ memory allocation function modifies the previous allocated space.
    calloc
    free
    malloc
    realloc

Post Your Question
Social Sharing
Search