You need to add a dot to indicate that the executable is in the current directory, as the current directory is not in the path:
./a.out
You need to add a dot to indicate that the executable is in the current directory, as the current directory is not in the path:
./a.out