DArk3Lite
public text v1 · immutablemain ()
{
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;
}
}