CHAPTER 8

image

Arrays

In this chapter, we will explain the following:

  • What is an array and how to declare one
  • How to store values in an array
  • How to read a known number of values into an array using a for loop
  • How to process elements of an array using a for loop
  • How to read an unknown number of values into an array using a while loop
  • How to extract a required element from an array with a subscript
  • How to find the sum of numbers stored in an array
  • How to find the average of numbers stored in an array
  • How to use an array to keep several counts
  • How to work with a string as an array of characters
  • How to reverse the elements in an array
  • How to write a ...

Get Learn to Program with C now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.