Array in C Programming
Array in C Programming
1
INTRODUCTION
•An array is a collection of elements of the same data type,
stored contiguously in memory.
2
TYPES OF ARRAYS
•1D Array: Linear collection of elements (like a list)
•Multidimensional Arrays: More than two dimensions, rarely used in basic programs
•Example:
3
One-Dimensional Array
• A single-dimensional array is a linear structure of
elements in C, where each element stores data of the
same data type and can be accessed using an index.
• Here the memory is allocated contiguously.
• Syntax:
data_type array_name[size];
• Initialization:
• int marks[5] = {90, 85, 78, 92, 88};
4
Two-Dimensional Array
• A two-dimensional (2D) array is a data structure that
organizes elements into a table-like grid with rows and
columns. It's essentially an array of arrays, allowing you to
store data in a structured, rectangular format.
• Syntax:
data_type array_name[row][column];
• Initialization:
int matrix[2][3] = {
{1, 2, 3},
{4, 5, 6}
};
5
Traversal: Visiting all elements
6
Limitations of Arrays
7
Storing multiple values of same type
of Arrays operations)
8
Find Maximum in Array:
9
References
Websites: Books:
GeeksforGeeks Programming with C by
TutorialsPoint T Jayapoovan.
10
THANK YOU
11