Professional Documents
Culture Documents
. Second Edition.
Behrouz A. Forouzan and Richard F. Gilberg
Brooks/Cole Publishing
(ISBN: 0-534-37482-4)
1/20/01 For latest errata check: http://www.brookscole.com/compsci/ Page 1
This document contains errata for the book. Status in the table below indicates the print run that contains the
correction: 0 indicates that the problem has been reported but not yet corrected, 2 indicates that the errata was
corrected in the second printing, and so forth..
Status Page Subject Correction
3 66 Problem 39 MS Visual C/C++ does not load the oating point I/O unless it nds a
oating point denition. When the program runs, it crashes with a
system message. To prevent the problem, change the variable deni-
tions to oat.
0 70 Table 3-1
Prex decrement has a side effect. Change 'N' to '
Y
' (Unary line 2)
0 92 Text
In Program 3-8 Analysis, change last line to read we cast the
result of the
oating-point
division into a character.
0 111 Exercise 21e
Reformat "--" operators: x y
0 111 Exercise 25c, d, e
Reformat "--" operators:
c. x + y++
d. x + x y
e. x + y x + x++ y
0 111 Exercise 26e
Reformat "--" operators: y++ + z + x++
3 137 Figure 4-14 Add semicolon at end of rst statement:
fun(a);
3 139 Figure 4-15 (1) Change name and add semicolon to prototype statement:
void fun (int *x);
(2) Add semicolon at end of rst statement:
fun (&a);
2 145 Figure 4-20 Move plus after ellipse next to innity symbol in both parts of the g-
ure.
0 151 Figure 4-23
In main, change third variable denition to
float y
(not c).
2 171 Problem 45,
Algorithm 4-2
Change lines 8 and 10 to read:
8 Display ceiling of product.
10 Display number raised to power 5.
0 180 De Morgans
Rule
Replace To demonstrate... below. just above expressions with:
When the original expression is complexthat is, when it con-
tains both
and
and
or
expressionsthe implied evaluation prece-
dence requires that parentheses be added around the original
and
expressions as shown in the following example.
Add parentheses around rst and last or expressions in the con-
verted expression as follows:
(!x || !y)(!t || u)
0 227 Project 60
Add parenthesis at beginning of formula for calculating Dec. 31
(
(
(year 1) * 365) + ...) % 7
Computer Science: A Structured Programming Approach Using C
. Second Edition.
Behrouz A. Forouzan and Richard F. Gilberg
Brooks/Cole Publishing
(ISBN: 0-534-37482-4)
1/20/01 For latest errata check: http://www.brookscole.com/compsci/ Page 2
0 228 Project 64
In the formula for calculating the roots, b belongs in numerator:
2 256 Program 6-14 Add closing parenthesis before semicolon in printf at statement 14.
2 298 Project 56 Calculation for rst day of year should add 1 before taking modulo.
Replace
(() % 7) + 1
with
(() + 1) % 7
0 298 Project 57
In monthly payment (MP) formula, add round to two decimal places
MP = (PR * IM * Q)
rounded to two decimal places
0 300 Project 59 The required output will not t in 20 rows. Change last line to delete
of and by 20 rows so it reads:
each tablemonitor display of 80 columns.
3 312 Figure 7-9
Format box for printf: change maximum width to
minimum
width.
3 356 Figure 8-7(a) Right Column: remove 'n' from initialization of
lotsOfNumbers
.
int lotsOfNumbers [1000] = {0};
0 418 Problem 34
Delete hint in last line of problem.
3 474 Figure 10-4 Denition of p should be pointer, as:
int *p;
2 627 Program 12-9 This program works only in Big-Endian hardware (see page 625).
2 672 Program 13-4 At statement 22 add:
fseek (fp1, 0, 2);
For more information on this, see the one program download
read.me le for Chapter 13
2 676 Program 13-5 Line 72, delete the dereference (*) so it reads:
if (ioResult)
.
0 792 Figure C-9
Change text in termination from END to
STOP
0 796 Figure C-16
Reverse blocks in loop:
sum = sum + num THEN
READ (num)
3 872 Exercise 29 The answers are mislabeled. Change answers b to d, c to b, e to d,
and c to e. Then change the new answer c as shown below:
a.
num[2]
b.
num[i + j]
c.
num[0] + num[num[1]]
d.
num[j]
e.
num[i] + num[j]
3 873 Exercise 33 Exchange answers to b and d so that b becomes d and d becomes b.
Status Page Subject Correction
x1
b b
2
4ac +
2a
--------------------------------------- = x1
b b
2
4ac
2a
-------------------------------------- =