The reason is that test is a UNIX built-in command. When you type test you are running this UNIX command instead of your executable program!
To run the program, prefix it with ./, i.e., type
this instead:
./test
make is another name that you should avoid.
Bottom line: Avoid naming your executable files with names that are UNIX commands. (If your program can't run, check that it doesn't have the same name as a UNIX command.)