char newvalue[15]=”I Love India”;

long pfile;

char *filename = “C:\\Sample.txt”;

pfile = fopen( filename,”a+” );

if(pfile == NULL)

{

printf( “Error in opening the filename – %s “,filename );

}

fputs(newvalue,pfile );

fputs( “\n”,pfile );

fclose( pfile );