You mention that to run, you used this command - ./filename.c. This command is creating issue. You should run the object file not the source code file. The proper command is ./filename
./filename.c
./filename