C puzzles: #2 and #3

utzoo!decvax!ittvax!tpdcvax!bobvan utzoo!decvax!ittvax!tpdcvax!bobvan
Wed Nov 10 13:06:31 AEST 1982


I received enough encouragement after posting my last C puzzle that
I've decided to post two more.  The next (and last) two puzzles I have
are of a different type.  I think they are simple enough that if I told
you what type of problem they were, that'd almost give it away.
Instead, I'll leave the problem statement very simple:

What is wrong with each of these two code fragments.

	#define	XSIZE	10
	#define	XMAX	XSIZE-1

second fragment:

	printf("    foos    bars    zots\n");
	printf("    ====    ====    ====\n");
	printf("    %4d    %4d    %4d\n", nfoos, nbars, nzots);

Again, I ask that all responses be sent to me rather than to the net
and promise to follow up with a tally and solutions.  Thanks to all who
followed my suggestion with the first puzzle.

				Bob Van Valzah
				(...!decvax!ittvax!tpdcvax!bobvan)



More information about the Comp.lang.c mailing list