C fprintf

C fprintf function pass arguments according to the specified format to the file indicated by the stream. This function is implemented in file related programs for writing formatted data in any file.

Syntax:
int fprintf(FILE *stream, const char *format, ...)
Example:
int main (void) 
{
   FILE *fileName;
   fileName = fopen("anything.txt","r");
   fprintf(fileName, "%s %s %d", "Welcome", "to",  2018);
   fclose(fileName);
   return(0);
}