Std-10-Computer-Chapter 15 Arrays
Std-10-Computer-Chapter 15 Arrays
Arrays Class 10
In C programming, Basic data types, namely int, float, char, double etc are types of
variables that can store only one value at a time.
If we want to process five different values, we need five different variables.
To handle very large amount of data, C supports a special kind of data type called an
array.
Need of Arrays
Maintain marks of all students of class
Maintain cost of all the products of super market
List of employees and their contact numbers
Maintain height and weight of each student of class
Types of Arrays
The arrays in C language can be classified in to following two categories :
(1) Single or One dimensional array
(2) Multidimensional array
The single dimensional array may have one row or one column while multidimensional
array has one or more rows and one or more columns.
The number of rows and columns are specified by user as per the program
requirement.
Multidimensional Array
The data associated with certain real life systems (such as digital image, a chess game
board, matrix, etc.) are available in two dimensions.
The simplest form of the multidimensional array is the two-dimensional array (More
than one rows and columns). The two dimensional array have row index as well as
column index.
Presented by Nuzhat Ibrahim Memon 3
Declaration of Two Dimensional Arrays
datatype arrayname [row_size][column_size];
Rowsize and column size must be integer and greater than 0. Example: int sales[3][5];