Online Test for C

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

  1. Which of the following data structures is useful in traversing a given graph by Depth first search(DFS)?
    Stack
    Queue
    List
    None of the above


  1. The maximum value that an integer constant can have varies from one compiler to another.
    True
    False

  1. For 16-bit compiler allowable range for integer constants is ______ ?
    -3.4e38 to 3.4e38
    -32767 to 32768
    -32768 to 32767
    -32668 to 32667

  1. Number of binary trees formed with 5 nodes are
    30
    36
    108
    42

  1. It is necessary that a loop counter must only be an int. It cannot be a float.
    True
    False


  1. Find Error/Output in follwing code:
  2.                                 
    int main ()
    
    {
      int x = 20, y = 35;
      x = y++ + x++;
      y = ++y + ++x;
      printf ("%d %d n", x, y);
    }
    55 92
    56 93
    57 94
    None of the above

  1. Find Error/Output in follwing code:
  2.                                 
    int main() {
    
      int x = 0, y = 0;
      if(x > 0)
        if(y > 0)
          printf("True"); 
      else
        printf("False"); 
    }
    No Output
    True
    False
    Error because of dangling else problem

  1. A full binary tree with n leaves contains
    n nodes
    2n - 1 nodes
    log2 n nodes
    2n nodes

  1. Find Error/Output in follwing code:
  2.                                 
    void main() 
    

      int x=10,*y,**z; 
      y=&x; 
      z=&y; 
      printf(\"%d%d%d\",*y,**z,*(*z)); 
    }
    101010
    100xaa54f10
    Run time error
    No Output

Post Your Question
Social Sharing
Search