Arrays
Gapfill exercise
Enter your answers in the gaps. When you have entered all the answers, click on the "Check" button.
What is Array?
An array in C or C++ is a collection of items stored at
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
memory
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
and elements can be accessed
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
using
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
of an array. They are used to
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
similar type of
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
as in the data type must be the same for all elements. They can be used to store collection of
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
data types such as int,
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
, double, char, etc of any
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
type. To add to it, an array in C or C++ can store
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
data types such as the
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
, pointers etc. Given below is the
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
representation of an array.
Why do we need arrays?
We can use
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
variables (v1, v2, v3, ..) when we have a
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
number of objects, but if we want to store a
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
number of instances, it
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
difficult to manage them with
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
variables. The idea of an array is to
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
many instances in one
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
.
What are the advantages of an Array in C?
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
access of elements using array
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
.
Use of less line of
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
as it creates a single
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
of multiple elements.
Easy
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
to all the elements.
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
through the
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
becomes easy using a
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
loop.
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
becomes easy as it can be
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
by writing less line of
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
.
What are the disadvantage of an Array in C?
Allows a
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
number of
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
to be entered which is decided at the time of
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
. Unlike a linked list, an
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
in C is not
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
.
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
and
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
of elements can be costly since the
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
are needed to be managed in accordance with the new
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
allocation.
Difference between pointer and array in C?
Arrays and
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
are two
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
things (we can check by applying sizeof). The confusion happens because
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
name indicates the
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
of first element and
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
are always passed as
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
(even if we use square bracket).
What is 2D array?
We can have multidimensional arrays in C like
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
and 3D array. However the most popular and frequently used
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
is 2D – two
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
array. In this post you will learn how to
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
, read and write
2D
access
accomplished
address
array
arrays
becomes
code
contiguous
data
declaration
declare
deletion
derived
different
dimensional
dynamic
elements
fixed
float
index
indices
Insertion
large
locations
memory
normal
particular
picturesque
pointer
pointers
primitive
Random
randomly
represent
single
small
Sorting
store
structures
Traversal
variable
in 2D array along with various other features of it.
Check
OK