Over 5 days this question remained in my mind "What do mean by arrays"?
Over 5 days this question remained in my mind "What do mean by arrays"?
Basically an array is a variable that holds multiple values. For instance a single variable called "a" can hold a single value as in "a=1". Turning that variable into an array makes it sort of like a list of values that are accessible via that same variable name but with an index added (most arrays are zero indexed), for example a="9 5 6 3 2" gives us a[0]=9, a[1]=5, a[2]=6, a[3]=3, a[4]=2. You can also assign a value to an array index directly, for example a[4]=5 would change the value in the slot a[4] from a 2 to a 5. How you initialize and populate an array variable varies depending on which language you are using, but they all behave basically the same way.
Basically an array is a variable that holds multiple values. For instance a single variable called "a" can hold a single value as in "a=1". Turning that variable into an array makes it sort of like a list of values that are accessible via that same variable name but with an index added (most arrays are zero indexed), for example a="9 5 6 3 2" gives us a[0]=9, a[1]=5, a[2]=6, a[3]=3, a[4]=2. You can also assign a value to an array index directly, for example a[4]=5 would change the value in the slot a[4] from a 2 to a 5. How you initialize and populate an array variable varies depending on which language you are using, but they all behave basically the same way.