You might sometimes come across obfuscated code - one area that can be badly obfuscated, IMO, is the 'for' loop. I found this routine that calculates PI to 800 decimal places.
int a=10000,b,c=2800,d,e,f[2801],g;main(){for(;b-c;)f[b++]=a/5;
for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)for(b=c;d+=f[b]*a,
f[b]=d%--g,d/=g--,--b;d*=b);}
Expanded a little
#include <stdio.h>
int main(void)
{
int a = 10000, b = 0, c = 2800, d = 0, e = 0, f[2801], g = 0;
for(;b-c;)
f[b++]=a/5;
for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)
for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);
printf("\n");
return 0;
}
It took me quite a while to figure out what actually is happening and write the routine in what I call normal code.
The reason for posting it? - do you really know the intricacies of the for loop? I didn't!
John