> We could have been "nice" and held up the delusion that we were still considering them, and let them down later with some vacuous corporate platitude like "you were great but we ultimately gave the role to a stronger candidate". Providing instant feedback that their skills were just not up to snuff is not 'nice' but it's more compassionate in the long run
You're right, however
> At one point I said literally, "You know this interview is for a C coding position, right?"
This is absolutely not the right way to go about it.
It's completely fair to say "hey, thanks for your time but we really need someone with C experience and we don't think you're a good fit for what we're looking for", but that's not even close to what it sounds like you did
You can cut an interview short and make it clear they won't be considered without being a huge asshole about it