All pastes #802541 Raw Edit

DArk3Lite

public text v1 · immutable
#802541 ·published 2007-11-30 11:45 UTC
rendered paste body
main ()

{
     int room, room_number;
     double lenght, breadth, cost;
     char hotel;
     FILE * in= fopen("rooms.txt", "r");
     FILE * out= fopen("rooms.out", "w");
     
     if (in == NULL)
     { 
            printf("File cannot be found");
            return 1;
            }
     else
     {
          printf("File opened successfully.\n");
          }
          
          while(fgets(hotel, 1000, in)) {
               printf("%d", hotel);
 
     if (out == NULL)
     { 
            printf("File cannot be found or created");
            exit(1);
            }
            
     printf("\n\nNow closing file...\n");
    fclose(out);
    return 0;
  }
}