i compiled a c code and when I try to run it with ./
command, it gives me -bash: ./hw : Permission denied .
please help me.
note : i use Mac os Mojave.
C code:
#include <stdio.h>
int main()
{
int n;
FILE *ptr;
ptr = fopen("input.txt", "r");
fscanf(ptr,"%d", &n);
printf("%d",n);
fclose(ptr);
return 0;
}
Compile command:
gcc -c hw.c -o hw