08.01.2023 Views

Learn to Program with C_ Learn to Program using the Popular C Programming Language ( PDFDrive )

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ Index

fprintf function, 111–112

Fractions

integer values, 293

manipulation, 294

printFraction, 293

write functions, 294–295

fscanf function, 108

Functions, 165, 304

classification number, 186–187

data processing, 169

double value, 185

factorial (see Factorial function)

getchar and getc, 165

header, 168–169

highest common factor, 165

highest common factor (HCF), 175–178

if…else statements, 173–175

main statement, 165

max variable, 170–172

net pay calculation, 185

program, 167–168

prototype, 168

skipLines, 166

sum of exact divisors, 186

• G

getLargest function, 300

getString and readChar function, 286

getString function, 228–229

• H

Highest common factor (HCF)

do…while statement, 133–134

function, 175

lowest common multiple (LCM), 177–178

printf statement, 176

prototype, 177

repetition logic program, 96–97

scanf, 176

• I, J, K

if statement

assignment statements, 71

boundary case, 73

condition, 69

construct, 70

C program, 69–70

indent, 71

integer, 73

program, 69, 74–75

pseudocode, 69, 71

style matches, 72

sum of, 72

temporary variable, 71

if…else statement

calculate pay, 77–79

selection logic programs, 75–77

Increment and decrement operators, 100

Infinite loop, 157

initialize function, 297

Insertion sort

analysis of, 258

array, 252

ascending order, 253

element, 259

insertionSort function, 257–258

method description, 253

proceeds, 253–256

while statement, 256

Integer value, 142

Interactive, 106

• L

Logical operators

AND (&&), 66–67

NOT (!), 68

OR (||), 67

Lowest common multiple (LCM), 177–178

• M

Manifest constants. See Symbolic constants

max function

header, 171

printf statement, 172

return statement, 171

returns values, 172

user types, 171

variables, 170

Merging process

implementation, 273–275

logic expression, 273

ordered lists, 271–273

Multiplication tables

defensive programming, 129

output results, 125

printf statement, 126, 128

program running, 127

validation, 129

309

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!