| |
| |
| |
First C ProgramProblem: The Squares of the Numbers from 4 to 9Introduction and Statement of the Problem | |
| |
| |
| |
A Pseudocode Solution to Problem | |
| |
| |
| |
Basic Concepts of a C Program | |
| |
| |
| |
Declaration, Assignment, and Print Statements | |
| |
| |
| |
The for Loop | |
| |
| |
| |
A Better Version of Program | |
| |
| |
| |
Enrichment: Running a C Program, Software Development Cycle | |
| |
| |
| |
More Details: Arithmetic Operations, Identifiers, for LoopsSummaryExercisesChapter | |
| |
| |
| |
Evaluating an ExpressionProblem: The Registrar's HeadacheIntroduction and Statement of the Problem | |
| |
| |
| |
Pseudocode for Problem | |
| |
| |
| |
Writing Program 2; The if Statement | |
| |
| |
| |
Enrichment: Creating Readable Output | |
| |
| |
| |
Relational Operators, Compound Assignment Operators | |
| |
| |
| |
Enrichment: Types float, double, and char; Standard Library of Functions | |
| |
| |
| |
Enrichment: DebuggingSummaryExercisesChapter | |
| |
| |
| |
Reading a Set of DataProblem: A Simple Payroll ProgramIntroduction and Statement of the Problem | |
| |
| |
| |
Pseudocode for Problem | |
| |
| |
| |
The while Loop | |
| |
| |
| |
Reading Data�scanf | |
| |
| |
| |
Writing Program | |
| |
| |
| |
Enrichment: Improving the Input/Output--Prompts and Printing | |
| |
| |
| |
The if-else Statement and the Conditional OperatorSummaryExercisesChapter | |
| |
| |
| |
Summation, Stepwise Refinement, and Nested LoopsProblem: The Sultan's Gift: The Sum of the Squares of the Numbersfrom 1 to 30Introduction and Statement of the Problem | |
| |
| |
| |
Pseudocode for Problem | |
| |
| |
| |
Program 4 (First Version) | |
| |
| |
| |
Enrichment: Other Versions of Program 4--Defining a Constant and Reading Data | |
| |
| |
| |
Enrichment: Using a Nested Loop | |
| |
| |
| |
Enrichment: Recommendations on Style; Structured ProgrammingSummaryExercisesChapter | |
| |
| |
| |
| |
| |
| |
Function Subprograms | |
| |
| |
| |
Programmer-Defined Functions | |
| |
| |
| |
Program 5; Location of Functions | |
| |
| |
| |
Void and Parameterless Functions | |
| |
| |
| |
Enrichment: Input-Output-Process (I-P-O) Comments | |
| |
| |
| |
Enrichment: Using Functions to Produce a Multiplication Table | |
| |
| |
| |
Enrichment: Calls to printf and scanf--Side Effects Versus Return Values | |
| |
| |
| |
Enrichment: A First Look at Parameters Which are PointersSummaryExercisesChapter | |
| |
| |
| |
More on Control StructuresProblem: Classifying Months and DaysIntroduction and Statement of the Problem | |
| |
| |
| |
Pseudocode for Problem | |
| |
| |
| |
The Main Program; Using a do-while Loop and the User-Response Method | |
| |
| |
| |
The Function classify | |
| |
| |
| |
The Remaining Functions | |
| |
| |
| |
Entire Program | |
| |
| |
| |
More on do-while Loops, Nested-if Statement | |
| |
| |
| |
Additional Control Structures: switch, break, and continue Statements; exit Function | |
| |
| |
| |
Logical and Relational Operators, Short-Circuit EvaluationSummaryExercisesChapter | |
| |
| |
| |
ArraysProblem: Averaging Sets of NumbersIntroduction and Statement of the Problem | |
| |
| |
| |
Header (or Parameter) Values; Pseudocode for Problem | |
| |
| |
| |
Program 7, Part 1 | |
| |
| |
| |
Arrays | |
| |
| |
| |
Using an Array--Program 7, Part 1 | |
| |
| |
| |
Using Arrays with Functions--Program 7, Part1 | |
| |
| |
| |
The Rest of Program | |
| |
| |
| |
Enrichment: Analysis of Program 7: Testing and Modularity | |
| |
| |
| |
Enrichment: Two-dimensional Arrays | |
| |
| |
| |
Enrichment: Detecting the End of a Set of Data: EOF Method; Return Value from scanfSummaryExercisesChapter | |
| |
| |
| |
PointersProblem: Averaging Sets of Numbers, RevisitedIntroduction | |
| |
| |
| |
Pointers | |
| |
| |
| |
Using Parameters Which Are Pointers (A Second Look) | |
| |
| |
| |
Pointers and Arrays | |
| |
| |
| |
Modifying Some Functions from Program 78.5 Program 8: Using Pointer Notation for the Arrays in Program 7SummaryExercisesChapter | |
| |
| |
| |
Character StringsProblem: Preparing a Direct Mail AdvertisementIntroduction and Statement of the Problem | |
| |
| |
| |
Declaring, Initializing, Printing, and Reading Strings | |
| |
| |
| |
String Manipulation Functions from the Standard Library | |
| |
| |
| |
String Input/Output Functions: gets, puts | |
| |
| |
| |
Writing Some Useful String Functions of Our Own | |
| |
| |
| |
Program | |
| |
| |
| |
Enrichment: Using Data Type char: getchar, putchar; Functions from ctype.h | |
| |
| |
| |
Enrichment: Arrays of StringsSummaryExercises | |