This video contains the concept of Arrays in C Programming.
Firstly we will solve one question without Arrays then we will come to know why the concept of Array was developed.
After realising the need of Array we will write the program using Array
After the Program we will learn the definition of an Array
Then one more program based on Array will be discussed .
I am sure after watching this video the concept of Array will become easy for you .
Defintion of Arrays
Array is the collection of related types of data.
In other words , Array is the collection of Data of the Same type.
Example :
int a [5] ;
The above statement indicates array name is a and it has 5 elements
All the elements type is int
Name of First Element is : a[0]
Name of Second Element is : a[1]
Name of Third Element is : a[2]
Name of Fourth Element is : a[3]
Name of Fifth Element is : a[4]
It means all the elements of an array has name a but has different indexes ( also called as subscript)
Here , 0 , 1 , 2 ,3 ,4 are called as Index or Sub-Script
Let's take one more example
Example :
float a [5] ;
The above statement indicates array name is a and it has 5 elements.
All the elements has type float .
Name of First Element is : a[0]
Name of Second Element is : a[1]
Name of Third Element is : a[2]
Name of Fourth Element is : a[3]
Name of Fifth Element is : a[4]
It means all the elements of an array has name a but has different indexes ( also called as subscript)
Here , 0 , 1 , 2 ,3 ,4 are called as Index or Sub-Script
One point to note here is that :
Irrespective of the type of array , Indexes (OR Sub-script ) of an array has to be int .
Please Do give your valuable feedback and Also like share and comments
Thanks and Regards
GABS CLASSES