Odd Programme


It's just a little bit of especiallies C programmes, try understand it!

To begin with a little programme. I have wrote it, it run. Realy !
main(a){printf("%i",!a?0:main(a-1));return(!!a)*(a-1);}

To continue, this programme loop infinitely, without any loop!
Note: it works under Linux-x86 and gcc, I never test it in other way.
#include <stdio.h>

#define M 2

int *r=0;

int f()
  {
   int i;
   if( r == 0 )
      r = *((&i)+M);
   else
      *((&i)+M) = r;

   printf("Ho!\n");
  }

int main()
  {
   f();
   f();
  }


This is a programme from "The Third International Obfuscated C Code Contest" by Landon Curt Noll and Larry Bassel. See copyright here
cat =13 /*/ >/dev/null 2>&1; echo "Hello, world!"; exit
*
*  This program works under cc, f77, and /bin/sh.
*
*/; main() {
      write(
cat-~-cat
     /*,'(
*/
     ,"Hello, world!"
     ,
cat); putchar(~-~-~-cat); } /*
     ,)')
      end
*/


To conclude a programme of Steve Baker (the original author of TuxKart, Plib and more over):
int main()
{
 int a = 10 ;

 int n = ( a + 4 ) / 5 ;

 switch ( a % 5 )
 {
   case 0: do
           {
             putchar ( '*' ) ;
   case 4:   putchar ( '*' ) ;
   case 3:   putchar ( '*' ) ;
   case 2:   putchar ( '*' ) ;
   case 1:   putchar ( '*' ) ;
           } while ( --n ) ;
 }

 printf ( "\n" ) ;
}


You can see lot of this programmes on the site of Steve Baker: http://www.sjbaker.org/steve/software/cute_code.html.
http://f.rodrigo.free.fr//me/prog/prog.php - Frédéric Rodrigo - f.rodrigo@ - (c)2005 GPL