How does an array differ from an ordinary variable?
Answers
Answer: An array can store multiple elements of same datatype, and an ordinary variable can store a single element .
Explanation:
Given : Difference between an array and an ordinary variable
To Find : How does an array differ from an ordinary variable?
Concept :
An array is a secondary or derived variable. An array is a collection of same datatype elements stored at contiguous memory locations. An array is the simplest data structure in which each data element can be accessed directly by only using its index number. In an array, index number starts from zero. In an array, multiple elements can be stored at contiguous memory location , whereas in an ordinary variable a single element is stored . An ordinary variable can store data of only that datatype, of which that variable is declared.
_________________________________________________
Related links :
Distribution between simple array and frequency array with examples.
https://brainly.in/question/27934469
Accept numbers into an array of size 10. Then accept a number from the user and perform linear search of that number in the array. If the number is present in the array, then display the array element number where number is found. In case of multiple presence of the element, display all the positions. Display a proper message if the number is not present in the array.
https://brainly.in/question/19548138
#SPJ3