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.

■ Contents

xii

7.11 Some Character Functions ................................................................................... 188

7.11.1 Position of a Letter in the Alphabet ......................................................................................... 189

7.12 Fetch the Next Integer .......................................................................................... 191

■Chapter ■ 8: Arrays 197

8.1 Simple vs Array Variable ......................................................................................... 197

8.2 Array Declaration .................................................................................................... 198

8.3 Store Values in an Array ......................................................................................... 199

8.3.1 About Not Using Element 0 ........................................................................................................ 203

8.4 Average and Differences from Average .................................................................. 203

8.5 Letter Frequency Count .......................................................................................... 206

8.6 Making Better Use of fopen .................................................................................. 209

8.7 Array as Argument to a Function ............................................................................ 211

8.8 String – Array of Characters ................................................................................... 213

8.8.1 Reverse the Characters in a String ............................................................................................ 217

8.9 Palindrome ............................................................................................................. 220

8.9.1 A Better Palindrome Function .................................................................................................... 223

8.10 Array of Strings – Name of Day Revisited ............................................................ 225

8.11 A Flexible getString Function ............................................................................... 228

8.12 A Geography Quiz Program................................................................................... 230

8.13 Find the Largest Number ...................................................................................... 233

8.14 Find the Smallest Number .................................................................................... 235

8.15 A Voting Problem .................................................................................................. 235

■Chapter ■ 9: Searching, Sorting, and Merging 243

9.1 Sequential Search .................................................................................................. 243

9.2 Selection Sort ......................................................................................................... 246

9.2.1 Analysis of Selection Sort .......................................................................................................... 252

9.3 Insertion Sort .......................................................................................................... 252

9.3.1 Analysis of Insertion Sort ........................................................................................................... 258

9.3.2 Insert an Element in Place ......................................................................................................... 259

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!