Ex. 1-1  Comment on the choice of names and values in the following code

	#define TRUE 0
	#define FALSE 1

	if ((ch = getchar()) == EOF)
   		not_eof = FALSE;

- The TRUE and FALSE defines are not using the conventional definition were TRUE is 1 and FALSE is 0; they are backwards. So if you were to use them in an IF statement the behavior would be the opposite of what they mean in English.
- The  'not_eof' variable is hard to follow since it is a negation. It would be simpler to follow if it was called 'eof' and be set to TRUE.
- What the bad choice of names and values do is to make the code not readable nor understandable.

Ex. 1-2  Improve this function

?	int smaller(char *s, char *t) {
?		if (strcmp(s, t) < 1)
?			return 1;
?		else
?			return 0;
?	}

	int isFirstSmaller(char *firstStr, char *secondStr) {
		if (strcmp(first, second) < 0)
			return 1;
		else
			return 0;
	}

Ex. 1-4  Improve each of this fragments

1.	if ( (c != 'y') && (c != 'Y') )
		return;

2.	if (length > BUFSIZE)
		length = BUFSIZE;

3.	flag = !flag;

4. 	quote = 0;
	if ( (*line) == '"')
		quote = 1;

5.	bit = val & 1;

Ex. 1-5  What is wrong with this excerpt?

?	int read(int *ip) {
?		scanf("%d", ip);
?		return *ip
?	}
?		...
?	insert(&graph[vert], read(&val), read(&ch));

First of all, it is not clear what they are trying to do. Also, when insert is being called, the read function is called twice which may produce unexpected results since the execution order is not defined and both calls may get executed without any synchronization.

Ex. 1-6  List all the different outputs this could produce with various orders of evaluation:

?	n = 1;
?	printf("%d %d\n", n++, n++);

1 2
2 1
1 1  (I'm not completely sure about this one, but think it is a possibility)

Using Apple's XCODE C compiler, the output is   1 2

Ex. 1-7  Rewrite these C/C++ excerpts more clearly:

This is how they look more clear:

1.
	if ( (!istty(stdin)) && (!istty(stdout)) && (!istty(stderr)) 
		return(0);

2.
	return (retval);

3.
	for (k = 0; k < 4; k++) {
		scanf(%lf", &dx);
		x += dx;
		
	}

Ex. 1-9  Identify the problems with this macro definition

?	#define ISDIGIT(c) ((c >= '0' && (c <= '9')) ? 1 : 0

If it is not used properly it may have strange behaviors. 

Since it doesn't have parenthesis that embrace all of its definition, it may have behave differently depending on the context.
Also, since the c parameter appears more than once, it may get evaluated more than once; for example:
	ISDIGIT(f = getchar())
will not be evaluation the same character for both comparisons.

Ex. 1-11  Comment on these comments.

a.
?	void dict::insert (string& w)
?	// returns 1 if w in directory, otherwise returns 0

The comment contradicts the code; it says that it returns a value while the function is declared as void. Also it doesn't say on which directory is w.

b.
?	if (n > MAX || n % 2 > 0) // test for even number

Comment doesn't add anything new that what you can't understand from the code. Also, it doesn't explain why it checks for 'n > MAX'.

c.
?	// Write a message
?	// Add to line counter for each line writtem
?
?	void write_message()
?	{
?		// increment line counter
?		line_number = line_number + 1;
?		fprintf(fout, "%d %s\n %d  %s\n%d  %s\n",
?			line_number, HEADER,
?			line_number +1, BODY,
?			line_Number +2, TRAILER);
?		// increment line counter
?		line_number = line_number + 2);
?	}

Function comment doesn't say anything about what kind of message the function writes. Also, it doesn't explicitly says how the global 'line_number' is going to be affected when the function finishes. It should say that it will be incremented by 3, since that is what the code does.

The 2 comments of "// increment line counter" are obvious and just clutter the code.