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:
gcc add.c -o 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.
gcc Desktop/add.c -o Desktop/add