Home / C Programming / Library Functions :: Point Out Errors

C Programming :: Library Functions

  1. Point out the error in the following program.

     #include 
    
      int main() 
      {     
          fprintf("FresherGATE");      
          printf("%.ef", 2.0);  
          return 0; 
      } 
    

     

  2. A.

    Error: unknown value in printf() statement.

    B.

    Error: in fprintf() statement.

    C.

    No error and prints "fresherGATE"

    D.

    No error and prints "2.0"

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Point out the error in the following program.

     #include
     #include 
    
      int main()
      {    
          char str1[] = "Learn through  FresherGATE0.com",  str2[120];       
          char *p;   
          p = (char*) memccpy(str2, str1, 'i', strlen(str1));    
         *p = '\0';    
          printf("%s", str2);  
          return 0; 
     }
    

  4. A.

    Error: in memccpy statement

    B.

    Error: invalid pointer conversion

    C.

    Error: invalid variable declaration

    D.

    No error and prints "Learn through Indi"

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Point out the error in the following program.

     #include
      
      int main()
      {   
         char str[] = "FresherGATE";     
         printf("%.#s %2s", str, str);     
         return 0;
      } 
    

  6. A.

    Error: in Array declaration

    B.

    Error: printf statement

    C.

    Error: unspecified character in printf

    D.

    No error

    View Answer

    Workspace

    Discuss Discuss in Forum