1 / 14

140 likes | 325 Views

Array. Cs212: DataStructures Lab 2. Array. Group of contiguous memory locations Each memory location has same name Each memory location has same type. a is the name of this array . Array index or subscript. Declaring , Allocating an initialize Arrays.

Download Presentation
## Array

**An Image/Link below is provided (as is) to download presentation**
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.
Content is provided to you AS IS for your information and personal use only.
Download presentation by click this link.
While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

**Array**Cs212: DataStructures Lab 2**Array**• Group of contiguous memory locations • Each memory location has same name • Each memory location has same type a is the name of this array Array index or subscript**Declaring , Allocating an initialize Arrays**• Declare array of zero (JAVA ) 1- Default Each int is initialized to 0 by default**Declare array of zero (c++)**1- using Loop 2- Or we can use initializer List OUT PUT**Initialize the array with different value using initializer**list (C++) (JAVA) Output**Initialize the array with user inputs**(C++) Output**Ex 1:**• Calculate value stored in each array element • Initialize elements of 10-element array to even integers start the even number from 2.**Answer:**(java)**Answer:**(C++) Output**EX2:**• Array elements • Can represent a series of values • We can sum these values**Answer:**(C++) Output**Answer:**(java)

More Related