SlideShare a Scribd company logo
1 of 14
Introducing One-Dimensional
Arrays
Introducing Two-Dimensional
Arrays
2
Introducing Arrays
• Each array contains data using same variable
name and data type
• Each value or object stored at a position
– Position numbers start at zero
• Zeroth element is first element
– Position also called index or subscript
– Index must be zero, a positive Integer, or an Integer
expression
3
Introducing Arrays
Name of array (note that
all elements of this array
have the same name,
intNetUnitsSold)
Position number (index
or subscript) of the
element within array
intNetUnitsSold
intNetUnitsSold(0)
intNetUnitsSold(1)
intNetUnitsSold(2)
intNetUnitsSold(3)
intNetUnitsSold(4)
intNetUnitsSold(5)
intNetUnitsSold(6)
intNetUnitsSold(7)
intNetUnitsSold(8)
intNetUnitsSold(9)
intNetUnitsSold(10)
intNetUnitsSold(11)
0
10
16
72
154
89
0
62
-3
90
453
178
78intNetUnitsSold(12)
Array consisting of 13 elements
4
Declaring and Allocating Arrays
  Sum Array application’s Form in design view.
5
Declaring and Allocating Arrays
• You must specify the size, name and data type
for an array before using
• Allocating memory for the array
– Use New to create the array
– Initializer list
• Specifies initial values of elements
6
Declaring and Allocating Arrays
  Declaring an array in the event handler.
Creating an
array of
Integers
7
Declaring and Allocating Arrays
• GetUpperBound method
– Returns highest index in the array
• Length property
– Returns the length of the array
8
Declaring and Allocating Arrays
Calculating the sum of the values of an array’s elements.
Retrieve the value of
each element and add
it to the total, one at a
time
9
Declaring and Allocating Arrays
Displaying the sum of the values of an array’s elements.
Introducing Two-Dimensional
Arrays
Two-Dimensional Rectangular
Arrays
• Two-dimensional arrays
– Also called double subscripted
– Requires two indices to identify particular elements
– Often used to arrange tables into rows and columns
– m-by-n array has m rows and n columns
Row 0
Row 1
Column 0 Column 1 Column 2 Column 3
Column index (or
subscript)Row index (or subscript)
Row 2
intA rray(0,0) intA rray(0,1) intA rray(0,2) intA rray(0,3)
intA rray(1,0) intA rray(1,1) intA rray(1,2) intA rray(1,3)
intA rray(2,0) intA rray(2,1) intA rray(2,2) intA rray(2,3)
Array name
Figure 18.4   Two-dimensional rectangular array with three rows and four columns.
Two-Dimensional Rectangular
Arrays
13
Two-Dimensional Rectangular
Arrays
• Array declaration
– Dim intNumbers As Integer(,) = New Integer(1, 1) {}
intNumbers(0, 0) = 1
intNumbers(0, 1) = 2
intNumbers(1, 0) = 3
intNumbers(1, 1) = 4
OR
– Dim intNumbers As Integer(,) =
New Integer(,) {{1, 2}, {3, 4}}
Example
Add all elements in a two-
dimensional array

More Related Content

What's hot

Data structure and its types
Data structure and its typesData structure and its types
Data structure and its typesNavtar Sidhu Brar
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation Anil Kumar Prajapati
 
Presentation on array
Presentation on array Presentation on array
Presentation on array topu93
 
2nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 12nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 1Aahwini Esware gowda
 
Presentation on queue
Presentation on queuePresentation on queue
Presentation on queueRojan Pariyar
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURERohit Rai
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureVivek Kumar Sinha
 
Introduction to Data Structure
Introduction to Data Structure Introduction to Data Structure
Introduction to Data Structure Prof Ansari
 
Array operations
Array operationsArray operations
Array operationsZAFAR444
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureRai University
 
Row major and column major in 2 d
Row major and column major in 2 dRow major and column major in 2 d
Row major and column major in 2 dnikhilarora2211
 

What's hot (20)

Data structure and its types
Data structure and its typesData structure and its types
Data structure and its types
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation
 
Array
ArrayArray
Array
 
Java arrays
Java arraysJava arrays
Java arrays
 
Presentation on array
Presentation on array Presentation on array
Presentation on array
 
2nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 12nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 1
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
 
Presentation on queue
Presentation on queuePresentation on queue
Presentation on queue
 
Array
ArrayArray
Array
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Data Structures (BE)
Data Structures (BE)Data Structures (BE)
Data Structures (BE)
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
 
Introduction to Data Structure
Introduction to Data Structure Introduction to Data Structure
Introduction to Data Structure
 
Data structures notes
Data structures notesData structures notes
Data structures notes
 
Array operations
Array operationsArray operations
Array operations
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structure
 
Row major and column major in 2 d
Row major and column major in 2 dRow major and column major in 2 d
Row major and column major in 2 d
 

Viewers also liked

Array linear data_structure_2 (1)
Array linear data_structure_2 (1)Array linear data_structure_2 (1)
Array linear data_structure_2 (1)eShikshak
 
Linked List data structure
Linked List data structureLinked List data structure
Linked List data structureMarcus Biel
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic NotationsRishabh Soni
 
Asymptotic Notation and Data Structures
Asymptotic Notation and Data StructuresAsymptotic Notation and Data Structures
Asymptotic Notation and Data StructuresAmrinder Arora
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsEhtisham Ali
 
Introduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationIntroduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationAmrinder Arora
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsNikhil Sharma
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application Tech_MX
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its typesNavtar Sidhu Brar
 
Data structures (introduction)
 Data structures (introduction) Data structures (introduction)
Data structures (introduction)Arvind Devaraj
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTUREArchie Jamwal
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsAakash deep Singhal
 

Viewers also liked (20)

2 arrays
2   arrays2   arrays
2 arrays
 
Arrays
ArraysArrays
Arrays
 
Ch5 array nota
Ch5 array notaCh5 array nota
Ch5 array nota
 
Arrays
ArraysArrays
Arrays
 
Data structure stack&queue basics
Data structure stack&queue   basicsData structure stack&queue   basics
Data structure stack&queue basics
 
Array linear data_structure_2 (1)
Array linear data_structure_2 (1)Array linear data_structure_2 (1)
Array linear data_structure_2 (1)
 
Array ppt
Array pptArray ppt
Array ppt
 
Linked List data structure
Linked List data structureLinked List data structure
Linked List data structure
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Asymptotic Notation and Data Structures
Asymptotic Notation and Data StructuresAsymptotic Notation and Data Structures
Asymptotic Notation and Data Structures
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Introduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationIntroduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic Notation
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its types
 
Stack
StackStack
Stack
 
Array in C
Array in CArray in C
Array in C
 
Data structures (introduction)
 Data structures (introduction) Data structures (introduction)
Data structures (introduction)
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
 

Similar to Lecture7 (20)

Arrays.pptx
Arrays.pptxArrays.pptx
Arrays.pptx
 
array-191103180006.pdf
array-191103180006.pdfarray-191103180006.pdf
array-191103180006.pdf
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
 
arrays.pptx
arrays.pptxarrays.pptx
arrays.pptx
 
Basic of array and data structure, data structure basics, array, address calc...
Basic of array and data structure, data structure basics, array, address calc...Basic of array and data structure, data structure basics, array, address calc...
Basic of array and data structure, data structure basics, array, address calc...
 
Array.pdf
Array.pdfArray.pdf
Array.pdf
 
Arrays
ArraysArrays
Arrays
 
arrayppt.pptx
arrayppt.pptxarrayppt.pptx
arrayppt.pptx
 
Arrays
ArraysArrays
Arrays
 
2D Array
2D Array 2D Array
2D Array
 
Arrays
ArraysArrays
Arrays
 
cluod.pdf
cluod.pdfcluod.pdf
cluod.pdf
 
DSA Unit II array.pptx
DSA Unit II array.pptxDSA Unit II array.pptx
DSA Unit II array.pptx
 
unit 2.pptx
unit 2.pptxunit 2.pptx
unit 2.pptx
 
Lecture 2.8 Arrays.pdf
Lecture 2.8 Arrays.pdfLecture 2.8 Arrays.pdf
Lecture 2.8 Arrays.pdf
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
Arrays
ArraysArrays
Arrays
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
2D-Arrays
2D-Arrays2D-Arrays
2D-Arrays
 
2D arrays
2D arrays2D arrays
2D arrays
 

Recently uploaded

Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)ChandrakantDivate1
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...
👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...
👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...manju garg
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdfKamal Acharya
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfsumitt6_25730773
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxMustafa Ahmed
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information SystemsAnge Felix NSANZIYERA
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 

Recently uploaded (20)

Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...
👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...
👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdf
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information Systems
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 

Lecture7

  • 2. 2 Introducing Arrays • Each array contains data using same variable name and data type • Each value or object stored at a position – Position numbers start at zero • Zeroth element is first element – Position also called index or subscript – Index must be zero, a positive Integer, or an Integer expression
  • 3. 3 Introducing Arrays Name of array (note that all elements of this array have the same name, intNetUnitsSold) Position number (index or subscript) of the element within array intNetUnitsSold intNetUnitsSold(0) intNetUnitsSold(1) intNetUnitsSold(2) intNetUnitsSold(3) intNetUnitsSold(4) intNetUnitsSold(5) intNetUnitsSold(6) intNetUnitsSold(7) intNetUnitsSold(8) intNetUnitsSold(9) intNetUnitsSold(10) intNetUnitsSold(11) 0 10 16 72 154 89 0 62 -3 90 453 178 78intNetUnitsSold(12) Array consisting of 13 elements
  • 4. 4 Declaring and Allocating Arrays   Sum Array application’s Form in design view.
  • 5. 5 Declaring and Allocating Arrays • You must specify the size, name and data type for an array before using • Allocating memory for the array – Use New to create the array – Initializer list • Specifies initial values of elements
  • 6. 6 Declaring and Allocating Arrays   Declaring an array in the event handler. Creating an array of Integers
  • 7. 7 Declaring and Allocating Arrays • GetUpperBound method – Returns highest index in the array • Length property – Returns the length of the array
  • 8. 8 Declaring and Allocating Arrays Calculating the sum of the values of an array’s elements. Retrieve the value of each element and add it to the total, one at a time
  • 9. 9 Declaring and Allocating Arrays Displaying the sum of the values of an array’s elements.
  • 11. Two-Dimensional Rectangular Arrays • Two-dimensional arrays – Also called double subscripted – Requires two indices to identify particular elements – Often used to arrange tables into rows and columns – m-by-n array has m rows and n columns
  • 12. Row 0 Row 1 Column 0 Column 1 Column 2 Column 3 Column index (or subscript)Row index (or subscript) Row 2 intA rray(0,0) intA rray(0,1) intA rray(0,2) intA rray(0,3) intA rray(1,0) intA rray(1,1) intA rray(1,2) intA rray(1,3) intA rray(2,0) intA rray(2,1) intA rray(2,2) intA rray(2,3) Array name Figure 18.4   Two-dimensional rectangular array with three rows and four columns. Two-Dimensional Rectangular Arrays
  • 13. 13 Two-Dimensional Rectangular Arrays • Array declaration – Dim intNumbers As Integer(,) = New Integer(1, 1) {} intNumbers(0, 0) = 1 intNumbers(0, 1) = 2 intNumbers(1, 0) = 3 intNumbers(1, 1) = 4 OR – Dim intNumbers As Integer(,) = New Integer(,) {{1, 2}, {3, 4}}
  • 14. Example Add all elements in a two- dimensional array