Online Test for C

  1. Spaces and commas are allowed in a variable name.
    True
    False

  1. Find Error/Output in follwing code:
  2.                                 
    int main()
    
    {
      char arr[7]="Network";
      printf("%s", arr);
      return 0; 
    }
    Network
    N
    Garbage value
    Compilation error


  1. Find Error/Output in follwing code:
  2.                                 
    int main()
    
    {
      int a = 10, b = 25;
      a = b++ + a++;
      b = ++b + ++a;
      printf("%d %d n", a, b);
    36 64
    35 62
    36 63
    30 28

  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. 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 a = 1, b=2, c=3;
      if(a,b,c)
      {
        printf("EXAM");
      }
    }
    EXAM
    No Output
    Run time error
    None of the above


  1. Find Error/Output in follwing code:
  2.                                 
    int main()  
    
    {
      printf("%d%d%d", sizeof(3.14f), sizeof(3.14l));
    }
    4160
    844
    3284
    None of the above

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

  1. How many times is a do while loop guaranteed to loop?
    0
    Variable
    1
    Infinitely

Post Your Question
Social Sharing
Search