Programming in C

(Barry) #1
532 prime numbers

Revising the Program to Generate a
Ta b le of Prime Numbers (Program
6.10A), 90-91
Sieve of Erastosthenes algorithm, 118
print_message( ) function, 120
print command (gdb debugger), 409
printf routine
output, 14
variables
displaying multiple values, 16-17
displaying values, 15-16
printf( ) function, 16, 348, 477
conversion characters, 350
flags, 348
Illustrating the printf Formats (Program
16.1), 350-355
program syntax, 13
type modifiers, 349
width and precision modifiers, 349
printing files via fprint( ) function,
368
procedural languages versus OOP lan-
guages, 413
program constants, symbolic names,
299-303
program looping
break statement, 62
Calculating the Eighth Triangular
Number (Program 5.1), 43
continue statement, 62-63
do statement, 44, 60-62
for statement, 44
Generating a Table of Triangular
Numbers (5.3), 47-50
relational operators, 46-50
scanf( ) function, Asking the User for
Input (Program 5.4), 51-52
triangular number calculation, 43-45
nested for loops, 53-54
output alignment, 50-51
user input, 51-52
while statement, 44, 56-60

programming
algorithms, 5
assembly languages, 6
case sensitivity, 11
common mistakes, troubleshooting,
497-500
higher-level languages, 6
instruction sets, 5
modular programming, 333-334
overview, 5
top-down, 137
Programming in Objective-C, 503
programming utilities
ar, 345
cvs, 344
grep, 345
make, 343-344
sed, 345
programs
#define statement
Introducing the #define Statement
(13.1), 300-302
More on Working with Defines (13.2),
302-303
A Simple Program for Use with gdb
(18.4), 396-398
Adding Debug Statements with the
Preprocessor (18.1), 389-391
arguments, calling, 13
arrays
Converting a Positive Integer to Another
Base (7.7), 110-111
Generating Fibonacci Numbers Using
Va r iable -Length Arrays (7.8),
115-117
Introducing Character Arrays (7.6),
108-109
Multidimensional Variable-Length Arrays
(8.13A), 150-152
Asking the User for Input (5.4), 51-52
assemblers, 6, 9

25 0672326663 index 6/10/04 2:04 PM Page 532

Free download pdf