UNIT-4 ARRAY & STRINGS
1
,Need of Array Variable
▪ Suppose we need to store rollno of the student in the integer
variable.
▪ int rollno;
▪ Now we need to store rollno of 100 students.
▪ int rollno101, rollno102, rollno103,
rollno104...;
▪ This is not appropriate to declare these many integer variables.
e.g. 100 integer variables for rollno.
▪ Solution to declare and store multiple variables of similar type is
an array.
▪ An array is a variable that can store multiple values.
, Array
▪ Array is a collection of variables of same type known by a single
name.
▪ The array is an important concept and helps the programmer in
managing many variables of the same type, because all the
elements of an array share a single name.
▪ An array is a fixed size sequential collection of elements of same
data type grouped under single variable name.
▪ Arrays can be divided into two categories
1. Single dimensional array
2. Multi-dimensional array
1
,Need of Array Variable
▪ Suppose we need to store rollno of the student in the integer
variable.
▪ int rollno;
▪ Now we need to store rollno of 100 students.
▪ int rollno101, rollno102, rollno103,
rollno104...;
▪ This is not appropriate to declare these many integer variables.
e.g. 100 integer variables for rollno.
▪ Solution to declare and store multiple variables of similar type is
an array.
▪ An array is a variable that can store multiple values.
, Array
▪ Array is a collection of variables of same type known by a single
name.
▪ The array is an important concept and helps the programmer in
managing many variables of the same type, because all the
elements of an array share a single name.
▪ An array is a fixed size sequential collection of elements of same
data type grouped under single variable name.
▪ Arrays can be divided into two categories
1. Single dimensional array
2. Multi-dimensional array