Path: utzoo!mnetor!tmsoft!dptcdc!jarvis.csri.toronto.edu!mailrus!ames!ucsd!rutgers!att!alberta!c415-23 From: c415-23@alberta.UUCP (Morris Barbara L) Newsgroups: comp.lang.c Subject: programming challenge (silly) Message-ID: <2102@jasper.UUCP> Date: 4 Mar 89 08:09:46 GMT Distribution: na Organization: U. of Alberta, Edmonton, AB Lines: 21 A friend and I tried to mimic the behaviour of the following program in the fewest characters possible. The best we were able to do was 98 characters (result of wc). Can anyone beat this? Email for our solution. main() { int n; scanf( "%d", &n ); if ( n < 1 || n >= 10 ) printf( "error\n" ); else printf( "answer is %d\n", factorial( n ) ); } int factorial( n ) int n; { if ( n == 1 ) return( n ); else return( n * factorial( n - 1 ) ); }