top of page

What are Arrays

Updated: Mar 9, 2023


In C programming, an array is a collection of elements of the same data type, such as integers, characters, or floating-point numbers, stored in contiguous memory locations.

Each element in an array is identified by an index or a subscript, which is a non-negative integer value that starts from zero and goes up to the size of the array minus one.

Arrays are useful for storing and manipulating large amounts of data efficiently. They can also be used to represent tables, matrices, and other multi-dimensional data structures.

In C, you can declare an array by specifying the data type of its elements, followed by its name, and its size in square brackets, like this:


int numbers[5];

numbers[0] = 10; numbers[1] = 20;


int numbers[5] = {10, 20, 30, 40, 50};

2 views0 comments

Recent Posts

See All

Stack Using Queue

A stack can be implemented using two queues in C. The basic idea is to use one queue for enqueue operations and another for dequeue operations. When an element is pushed onto the stack, it is enqueued

bottom of page