The longest code for printing "Hello World!"

During those tough B.tech days where we are introduced to C programming "hello world" was the first and the easiest of all the program's to begin with. A person wrote the most confusing code to print out the hello world for a competition.






  1. #include "stdio.h"
  2. #define e 3
  3. #define g (e/e)
  4. #define h ((g+e)/2)
  5. #define f (e-g-h)
  6. #define j (e*e-g)
  7. #define k (j-h)
  8. #define l(x) tab2[x]/h
  9. #define m(n,a) ((n&(a))==(a))
  10.  
  11. long tab1[]={ 989L,5L,26L,0L,88319L,123L,0L,9367L };
  12. int tab2[]={ 4,6,10,14,22,26,34,38,46,58,62,74,82,86 };
  13.  
  14. main(m1,s) char *s; {
  15. int a,b,c,d,o[k],n=(int)s;
  16. if(m1==1){ char b[2*j+f-g]; main(l(h+e)+h+e,b); printf(b); }
  17. else switch(m1-=h){
  18. case f:
  19. a=(b=(c=(d=g)<<g)<<g)<<g;
  20. return(m(n,a|c)|m(n,b)|m(n,a|d)|m(n,c|d));
  21. case h:
  22. for(a=f;a<j;++a)if(tab1[a]&&!(tab1[a]%((long)l(n))))return(a);
  23. case g:
  24. if(n<h)return(g);
  25. if(n<j){n-=g;c='D';o[f]=h;o[g]=f;}
  26. else{c='\r'-'\b';n-=j-g;o[f]=o[g]=g;}
  27. if((b=n)>=e)for(b=g<<g;b<n;++b)o[b]=o[b-h]+o[b-g]+c;
  28. return(o[b-g]%n+k-h);
  29. default:
  30. if(m1-=e) main(m1-g+e+h,s+g); else *(s+g)=f;
  31. for(*s=a=f;a<e;) *s=(*s<<e)|main(h+a++,(char *)m1);
  32. }
  33. }
Check out the above code, the person who wrote this code was the winner of The International Obfuscated C Code Contest which was to write the most confusing code possible and the above code simply prints out "Hello World"