Home / C Programming / Library Functions :: Discussion

Discussion :: 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

    Answer : Option B

    Explanation :

    Declaration Syntax:
    int fprintf (FILE *stream, const char *format [, argument, ...]);

    Example:
    fprintf(filestream, "%s %d %s", Name, Age, City);


Be The First To Comment