I hope your having a wonderful morning. I was on the Raspberry Pi website, and downloaded an issue of MagPi that taught you how to get started in the C language, and I'm so exited! The instructions told me to make a file, name it
gcc -o myprog /home/pi/Desktop/C/hello.c
Each time you compile the program, the generated executable is written in the folder you are in.
E.g. if you are in /home/pi/ And you run your command, you'll get an hello executable in the same folder
You use -o parameter to tell where to store the output executable, but you should provide a full path.
mkdir -p /home/pi/Desktop/C/bin/
gcc -o /home/pi/Desktop/C/bin/myprog /home/pi/Desktop/C/hello.c