(silly challenge); Can you beat this?

Gordon Cross crossgl at ingr.com
Wed Mar 15 02:38:32 AEST 1989


In article <37433 at think.UUCP> gordon at think.com (gordon linoff) writes:
}
}I wish I could take credit for this, but it is now down to 83 characters
}(84 with the trailing newline).
}
}And this is it . . .
}
}	main(y,x){for(scanf("%d",&x);--x%9;y*=x+1);
}	printf(x?"error\n":"answer is %d\n",y);}

Several people have made a similiar error in duplicating the "silly" program.
The challenge was that the original program and the new one behave EXACTLY
the same.  The example above fails to yield the correct answer if invoked
with arguments on the command line whereas the original program did...
Try it!
-- 

Gordon Cross             UUCP:      uunet!ingr!crossgl     "all opinions are
111 Westminister Way     INTERNET:  crossgl at ingr.com        mine and not those
Madison, AL 35758        MA BELL:   (205) 772-7842          of my employer."



More information about the Comp.lang.c mailing list