I'm not a C expert, but I've seen this topic discussed in the
newsgroup several times. What's the deal with writing such programs?
Why are they considered so interesting?
It is hard to do without getting creative. The idea is that you really
have to know the language and have a bit of creativity to be able to write
such a program.
The other thought is that if you can write such a program you 1) know a
lot about the language and 2) you can recall the appropriate information.
For example, everyone with a degree in Computer Science learned about
recursion. If I pose a challenge that requires recursion to solve it not
everyone will be able to figure it out even though they have all had
training on recursion. Having training is one thing. Using it effectively
is what employers are really looking for.
The truth of the matter is that many people are just good at using a
search engine or memorizing questions that people like to use in
interviews.
One other aspect of these questions is that once I know what the answer is
I can impress my friends by asking them the same question and watch them
struggle with finding the answer.
The specific challenge of writing a program that has no semicolons comes
from the fact that everyone is taught that:
int main(void)
{
return 0;
}
is a minimal program. You start with this and build from here. If this
really is the simpliest program and there is already one semicolon in it,
how do you get rid of the semicolon?
int main(void)
{
return 0
}
This will not compile. You actually have to make the code more complex to
be able to remove the semicolon.