Saved Bookmarks
| 1. |
Explain the needs for arrays Array |
|
Answer» Array is collection of same type of elements. With the same name we can store more elements. The elements are distinguished by using its index or subscript. To store 50 marks of 50 students we have to declare 50 variables, it is a laborious work. Hence the need for arrays arise. By using array this is very easy as follows int mark[50]. Here the index of first element is 0, then 1, 2, 3, etc upto 49. |
|