Answer to C Programming Puzzle
Wednesday August 13, 2008
That was too easy perhaps (malempati sussed what it did) though no one actually gave me the answer I was looking for. It's a recursive program as best I can make out and I had to set the stack size to a very large number (5 MB) on windows to stop it crashing.
If you want to see more examples of obfuscated code (I know I don't!) take a look at the past entries to the IOCCC website. This is the home of the International Obfuscated C Code Contest. If anyone want to send in their own original obfuscated code I'll put them on a special page in the C (or C++) code library.
- Link to C Code Library
- Link to C++ Code Library


After looking at again carefully and reading the answer posted by David, I have re arranged the program in readable manner, now who are still unable to understand the answer can get the idea what is happening.
main program is calling function which is recursively calling itself depending upon result of ternary operator.
function name can be “_” a underscore and has arguments as ‘__’ ( single underscore) , ‘___’ ( double underscore) , ‘____’ ( triple ) . As no datatyope is mentioned for them so they are taken as “int” by default.
#include
#include
_(__,___,____)
{
___/__1&&___%__
here is re arranged code
#include
#include
_(__,___,____)
{
___/__1&&___%__
main is calling the function _(_,__,___) as shown with arguments:
main()
{
_(100,0,0);
}
_(__,___,____)
{
___/__1&&___%__
unable to paste re arrabged function