/*ogrenci.txt dosyasindan ad ve notlari okuyup ekrana yazdirir */

#include <stdio.h>
#include <stdlib.h>


int main()
{ 
   char name[ 30 ]; 
   int grade;  
   
   FILE *cfPtr; 
   
    if ( ( cfPtr = fopen( "students.txt", "r" ) ) == NULL ) {
      printf( "File could not be opened\n" );
   } 
   
   
   else { 
        
      printf( "Name Grade\n" );
      fscanf( cfPtr, "%s %d", name, &grade);

      
      while ( !feof( cfPtr ) ) { 
         printf( "%s %d\n", name, grade);
         fscanf( cfPtr, "%s %d", name, &grade);
      } 

      fclose( cfPtr ); 
   } 
   
   
printf("\n\n");
system("pause");

return 0; 

}
