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

6.4 Characters in Arithmetic Expressions .................................................................... 143

6.4.1 Uppercase To/From Lowercase ................................................................................................. 144

6.5 Read and Print Characters ..................................................................................... 145

6.6 Count Characters .................................................................................................... 152

6.6.1 Count Characters in a Line ........................................................................................................ 153

6.7 Count Blanks in a Line of Data ............................................................................... 153

6.8 Compare Characters ............................................................................................... 155

6.9 Read Characters from a File ................................................................................... 156

6.10 Write Characters to a File ..................................................................................... 157

6.10.1 Echo Input, Number Lines ........................................................................................................ 157

6.11 Convert Digit Characters to Integer ...................................................................... 161

■Chapter ■ 7: Functions 165

7.1 About Functions ...................................................................................................... 165

7.2 skipLines ............................................................................................................ 166

7.3 A Program with a Function ..................................................................................... 167

7.3.1 The Function Header .................................................................................................................. 168

7.3.2 How a Function Gets Its Data .................................................................................................... 169

7.4 max ......................................................................................................................... 170

7.5 Print the Day ........................................................................................................... 173

7.6 Highest Common Factor ......................................................................................... 175

7.6.1 Using HCF to Find LCM .............................................................................................................. 177

7.7 factorial .................................................................................................................. 178

7.7.1 Using Factorial ........................................................................................................................... 181

7.7.2 Combinations ............................................................................................................................. 182

7.8 Job Charge ............................................................................................................. 184

7.9 Calculate Pay .......................................................................................................... 185

7.10 Sum of Exact Divisors .......................................................................................... 186

7.10.1 Classify Numbers ..................................................................................................................... 186

xi

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!