You'll need to make sure the Terminal is using the Desktop as the working directory already, or specify a more specific path. Assuming that the Desktop is subfolder in the home folder ( that's the way it is with Linux - I haven't done this on a mac ), you have two options:
Code:
cd Desktop
gcc add.c -o add
./add
or
Code:
gcc Desktop/add.c -o Desktop/add
Desktop/add
Again - I haven't done much programming on a mac, I don't know if these commands are the same, but they are standard for UNIX, so my guess is they are.