While Running C program on X-Code this is what it is showing up in error - Thread 1: EXC_BAD_ACCESS (code=1, address=0x68) : [This is Exactly what XCode is showing when I'm running the code.][1]


  [1]: https://i.stack.imgur.com/lXjq3.jpg


`
        
 

  #include <stdio.h>

int main()


{
    FILE *f1;

    char c;

    printf("Data Input\n\n");

    f1 = fopen("/Users/karanjeetsinghbagga/Desktop/File Management in C/Fille Management in C/INPUT.txt", "W");

    while((c=getchar())!= EOF)

        putc(c,f1);

    fclose(f1);

    printf("\nData Output\n\n");

    f1 = fopen("/Users/karanjeetsinghbagga/Desktop/File Management in C/Fille Management in C/INPUT.txt", "R");

    while((c=getchar()) !=EOF)

        printf("%c",c);

    fclose(f1);
    
    
    
           
    return 0;
}`



*This is the code which I was writing And it is directly copied from E.Balagurusamy Programming in Ansi C. I tried even creating a text file and putting it in the source folder of the code also changed the execution folder for the code but it is not running and when the same code is being run using terminal it is showing -* ***Segmentation fault: 11*** please help me with this and do consider that I am a beginner in ***X-Code, MacOS, and coding in C***.  