I\'m trying to run a Hello World program but am getting the error
./ex1.c: line 3: syntax error near unexpected token `(` ./ex1.c: line 3: `int main (int arg
You can't run a .c file just by using ./ex1.c; you have to compile it into a runnable program first.
.c
./ex1.c
Assuming you have a Linux/OS X machine, use gcc -Wall ex1.c -o ex1 to compile it (or, more simply, make ex1). Then you can ./ex1 to run the program.
gcc -Wall ex1.c -o ex1
make ex1
./ex1