title: fprintf is not printing to the file
body: <p>In following code the fprintf is not printing to the file and printf is showing wrong output:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
   void main()
  {  
      FILE *fp;  
      int d,w,t;
      fp = fopen("file.txt","r+");//already created file having value 10
      fscanf(fp,"%d",&amp;d); 
      printf("%d",d);//print value 10
      t=ftell(fp);
      fseek(fp,t,SEEK_END);
      fprintf(fp,"%d",1000); // printing 1000 to the file
      fscanf(fp,"%d",&amp;w);
      printf("%d",w); // this printf is still printing wrong value 12803
      fclose(fp);
      getch();
  }
  </code></pre>