Home / C Programming / Pointers :: Point Out Errors

C Programming :: Pointers

  1. Which of the statements is correct about the program?

         #include  int main() {     int i=10;     int *j=&i;     return 0; } 
  2. A.

    j and i are pointers to an int

    B.

    i is a pointer to an int and stores address of j

    C.

    j is a pointer to an int and stores address of i

    D.

    j is a pointer to a pointer to an int and stores address of i

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Point out the error in the program

    #include 
    
     intmain() 
     {   
        int a[] = {10, 20, 30, 40, 50};               
        int j;    
        for(j=0; j5; j++)    
        {      
           printf("%d\n", a);    
           a++;   
        }    
       return 0; 
    } 
    

     

  4. A.

    Error: Declaration syntax

    B.

    Error: Expression syntax

    C.

    Error: LValue required

    D.

    Error: Rvalue required

    View Answer

    Workspace

    Discuss Discuss in Forum