SlideShare une entreprise Scribd logo
1  sur  12
Chapter # 12

     Arrays




  Hamza Mohammad Iqbal
Array
• An array is a set of like variables arranged in
   sequence identified by their subscripts.
                         OR
  An array is a collection of subscripted variables
with the same variable name.
List and tables are called arrays. A list is referred
to as one-dimensional array and a table as two-
dimensional array.

                     Hamza Mohammad Iqbal
Subscripted Variable
• Subscripted variable names are similar to
  simple variable names except that they are
  followed by a subscript.
• Subscript must be either zero or a positive
  integer and must always be enclosed in
  parentheses.
• For example A(2) , B$(4).


                   Hamza Mohammad Iqbal
Storage in subscripted variable
• Each subscripted variable is used to store one
  number or string.
• Values are assigned to the subscripted
  variables by LET, READ or INPUT statements.




                   Hamza Mohammad Iqbal
Filling an array
• Strings or numbers assigned to subscripted
  variables in arrays using LET READ or INPUT
  statement is called filling an array.
• For e.g.
• 10 READ ART$(1),ART$(2)
• 20 DATA PEN,BOOK
• END


                   Hamza Mohammad Iqbal
BIG ARRAYS : DIM
• DIM is a short name used for DIMension.
• It is used to declare an array especially to specify
  more than 10 subscripts.
• DIM statement causes the computer to reserve
  more spaces in its memory required for big
  arrays.
• The number of subscripted variables can be
  increased including the DIM statement in an array
  program.
• Syntax: Line# DIM <VariableName> (subscripted value)

                        Hamza Mohammad Iqbal
Error without using DIM
• When you run a program of an array to store
  more than 10 values. In the output you got
  the error such like BAD subscript error in line#
  because the computer ordinarily reserves
  memory spaces for only 11 elements of an
  array.




                    Hamza Mohammad Iqbal
Two Dimensional Array
• Two dimensional arrays are named the same
  way as one-dimensional arrays.
• Elements in a two-dimensional array are
  commonly referred to as doubly-subscripted
  variables.
• Format: Line# DIM (Array Name) (row,column)



                  Hamza Mohammad Iqbal
Filling two dimensional array
•   One way of filling a two dimensional array is by FOR …. NEXT nested loops.
•   For e.g.
•   10 DIM D(4,3)
•   20 FOR ROW = 1 TO 4
•   30 FOR COL = 1 TO 3
•   40 READ D(ROW,COL)
•   50 NEXT COL
•   60 NEXT ROW
•   70 DATA 3,5,6
•   80 DATA 76,5,3
•   90 DATA 45,4,74
•   100 DATA 34,65,7
•   110 END



                                Hamza Mohammad Iqbal
PRINTING TWO DIMENSIONAL ARRAY
•   10 DIM D(4,3)
•   20 FOR ROW = 1 TO 4
•   30 FOR COL = 1 TO 3
•   40 READ D(ROW,COL)
•   50 NEXT COL
•   60 NEXT ROW
•   70 PRINT “PRINT TWO DIMENSIONAL ARRAY”
•   80 FOR ROW = 1 TO 4
•   90 FOR COL = 1 TO 3
•   100 PRINT D(ROW,COL);
•   110 NEXT COL
•   120 PRINT
•   130 NEXT ROW
•   170 DATA 3,5,6
•   180 DATA 76,5,3
•   190 DATA 45,4,74
•   200 DATA 34,65,7
•   210 END



                                   Hamza Mohammad Iqbal
OUTPUT




Hamza Mohammad Iqbal
Manipulating data with Arrays
• Numerous operations on data can be
  performed using arrays. Such as finding
  particular element in an array, matching
  elements from two arrays and sorting an
  array.
• Important use of arrays is to store data that
  are used later for comparison.


                    Hamza Mohammad Iqbal

Contenu connexe

Tendances

Arrays in c language
Arrays in c languageArrays in c language
Arrays in c languagetanmaymodi4
 
Data Analysis with Python Pandas
Data Analysis with Python PandasData Analysis with Python Pandas
Data Analysis with Python PandasNeeru Mittal
 
Mesics lecture 8 arrays in 'c'
Mesics lecture 8   arrays in 'c'Mesics lecture 8   arrays in 'c'
Mesics lecture 8 arrays in 'c'eShikshak
 
Presentation on array
Presentation on array Presentation on array
Presentation on array topu93
 
Python and CSV Connectivity
Python and CSV ConnectivityPython and CSV Connectivity
Python and CSV ConnectivityNeeru Mittal
 
Array in c programming
Array in c programmingArray in c programming
Array in c programming2569294Mohan
 
Basic array in c programming
Basic array in c programmingBasic array in c programming
Basic array in c programmingSajid Hasan
 
Array in c programming
Array in c programmingArray in c programming
Array in c programmingMazharul Islam
 
Array in c programming
Array in c programmingArray in c programming
Array in c programmingManojkumar C
 
BAS 150 Lesson 4 Lecture
BAS 150 Lesson 4 LectureBAS 150 Lesson 4 Lecture
BAS 150 Lesson 4 LectureWake Tech BAS
 

Tendances (20)

Arrays in c language
Arrays in c languageArrays in c language
Arrays in c language
 
Data Analysis with Python Pandas
Data Analysis with Python PandasData Analysis with Python Pandas
Data Analysis with Python Pandas
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Mesics lecture 8 arrays in 'c'
Mesics lecture 8   arrays in 'c'Mesics lecture 8   arrays in 'c'
Mesics lecture 8 arrays in 'c'
 
Presentation on array
Presentation on array Presentation on array
Presentation on array
 
Python and CSV Connectivity
Python and CSV ConnectivityPython and CSV Connectivity
Python and CSV Connectivity
 
Array in c
Array in cArray in c
Array in c
 
Array in c programming
Array in c programmingArray in c programming
Array in c programming
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
Moving Data to and From R
Moving Data to and From RMoving Data to and From R
Moving Data to and From R
 
Basic array in c programming
Basic array in c programmingBasic array in c programming
Basic array in c programming
 
Arrays
ArraysArrays
Arrays
 
Arrays Basics
Arrays BasicsArrays Basics
Arrays Basics
 
Arrays
ArraysArrays
Arrays
 
Array in c programming
Array in c programmingArray in c programming
Array in c programming
 
Array in c programming
Array in c programmingArray in c programming
Array in c programming
 
Array C programming
Array C programmingArray C programming
Array C programming
 
Array in c++
Array in c++Array in c++
Array in c++
 
BAS 150 Lesson 4 Lecture
BAS 150 Lesson 4 LectureBAS 150 Lesson 4 Lecture
BAS 150 Lesson 4 Lecture
 
Arrays In C
Arrays In CArrays In C
Arrays In C
 

En vedette (16)

Aula de 17 02-2013
Aula de 17 02-2013Aula de 17 02-2013
Aula de 17 02-2013
 
Que me molesta
Que me molestaQue me molesta
Que me molesta
 
Presentation1
Presentation1Presentation1
Presentation1
 
Filo 02 26tptptptp
Filo 02 26tptptptpFilo 02 26tptptptp
Filo 02 26tptptptp
 
Trungthuc
TrungthucTrungthuc
Trungthuc
 
Bridge presentation
Bridge presentationBridge presentation
Bridge presentation
 
inSis Infoview
inSis InfoviewinSis Infoview
inSis Infoview
 
Indicadores 3 periodo
Indicadores 3 periodoIndicadores 3 periodo
Indicadores 3 periodo
 
inSis Oneview
inSis OneviewinSis Oneview
inSis Oneview
 
cisco case solve
cisco case solvecisco case solve
cisco case solve
 
Unip universidade paulista disciplina-online - sistemas de conteúdo onlin...
Unip   universidade paulista   disciplina-online - sistemas de conteúdo onlin...Unip   universidade paulista   disciplina-online - sistemas de conteúdo onlin...
Unip universidade paulista disciplina-online - sistemas de conteúdo onlin...
 
Assign 20 synergy worksheet
Assign 20 synergy worksheetAssign 20 synergy worksheet
Assign 20 synergy worksheet
 
éTica
éTicaéTica
éTica
 
Modelo de divulgação do projeto social
Modelo de divulgação do projeto socialModelo de divulgação do projeto social
Modelo de divulgação do projeto social
 
Contemplating the Beauty of Crimea...
Contemplating the Beauty of Crimea...Contemplating the Beauty of Crimea...
Contemplating the Beauty of Crimea...
 
Neurotransmitters and its mechanism of action
Neurotransmitters and its mechanism of actionNeurotransmitters and its mechanism of action
Neurotransmitters and its mechanism of action
 

Similaire à Chapter12

Basics of Python
Basics of PythonBasics of Python
Basics of PythonEase3
 
C-Programming Arrays.pptx
C-Programming  Arrays.pptxC-Programming  Arrays.pptx
C-Programming Arrays.pptxSKUP1
 
C-Programming Arrays.pptx
C-Programming  Arrays.pptxC-Programming  Arrays.pptx
C-Programming Arrays.pptxLECO9
 
Matlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IMatlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IVijay Kumar Gupta
 
Programming fundamentals week 12.pptx
Programming fundamentals week 12.pptxProgramming fundamentals week 12.pptx
Programming fundamentals week 12.pptxdfsdg3
 
Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions Ahmed El-Arabawy
 
Arrays and addressing modes
Arrays and addressing modesArrays and addressing modes
Arrays and addressing modesBilal Amjad
 
Arrays_and_Strings_in_C_Programming.pptx
Arrays_and_Strings_in_C_Programming.pptxArrays_and_Strings_in_C_Programming.pptx
Arrays_and_Strings_in_C_Programming.pptxsamreenghauri786
 
File Structure Concepts
File Structure ConceptsFile Structure Concepts
File Structure ConceptsDileep Kodira
 

Similaire à Chapter12 (20)

Unit 6. Arrays
Unit 6. ArraysUnit 6. Arrays
Unit 6. Arrays
 
Basics of Python
Basics of PythonBasics of Python
Basics of Python
 
C-Programming Arrays.pptx
C-Programming  Arrays.pptxC-Programming  Arrays.pptx
C-Programming Arrays.pptx
 
C-Programming Arrays.pptx
C-Programming  Arrays.pptxC-Programming  Arrays.pptx
C-Programming Arrays.pptx
 
Arrays.pptx
Arrays.pptxArrays.pptx
Arrays.pptx
 
Matlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - IMatlab Tutorial for Beginners - I
Matlab Tutorial for Beginners - I
 
Lisp and scheme i
Lisp and scheme iLisp and scheme i
Lisp and scheme i
 
Programming fundamentals week 12.pptx
Programming fundamentals week 12.pptxProgramming fundamentals week 12.pptx
Programming fundamentals week 12.pptx
 
Practical 03 (1).pptx
Practical 03 (1).pptxPractical 03 (1).pptx
Practical 03 (1).pptx
 
DataStructures.pptx
DataStructures.pptxDataStructures.pptx
DataStructures.pptx
 
Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions Course 102: Lecture 13: Regular Expressions
Course 102: Lecture 13: Regular Expressions
 
Dbms sql-final
Dbms  sql-finalDbms  sql-final
Dbms sql-final
 
Arrays and addressing modes
Arrays and addressing modesArrays and addressing modes
Arrays and addressing modes
 
Array
ArrayArray
Array
 
Radix sort
Radix sortRadix sort
Radix sort
 
Regular expression for everyone
Regular expression for everyoneRegular expression for everyone
Regular expression for everyone
 
Basics of array.pptx
Basics of array.pptxBasics of array.pptx
Basics of array.pptx
 
Arrays_and_Strings_in_C_Programming.pptx
Arrays_and_Strings_in_C_Programming.pptxArrays_and_Strings_in_C_Programming.pptx
Arrays_and_Strings_in_C_Programming.pptx
 
PHP array 1
PHP array 1PHP array 1
PHP array 1
 
File Structure Concepts
File Structure ConceptsFile Structure Concepts
File Structure Concepts
 

Dernier

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 

Dernier (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 

Chapter12

  • 1. Chapter # 12 Arrays Hamza Mohammad Iqbal
  • 2. Array • An array is a set of like variables arranged in sequence identified by their subscripts. OR An array is a collection of subscripted variables with the same variable name. List and tables are called arrays. A list is referred to as one-dimensional array and a table as two- dimensional array. Hamza Mohammad Iqbal
  • 3. Subscripted Variable • Subscripted variable names are similar to simple variable names except that they are followed by a subscript. • Subscript must be either zero or a positive integer and must always be enclosed in parentheses. • For example A(2) , B$(4). Hamza Mohammad Iqbal
  • 4. Storage in subscripted variable • Each subscripted variable is used to store one number or string. • Values are assigned to the subscripted variables by LET, READ or INPUT statements. Hamza Mohammad Iqbal
  • 5. Filling an array • Strings or numbers assigned to subscripted variables in arrays using LET READ or INPUT statement is called filling an array. • For e.g. • 10 READ ART$(1),ART$(2) • 20 DATA PEN,BOOK • END Hamza Mohammad Iqbal
  • 6. BIG ARRAYS : DIM • DIM is a short name used for DIMension. • It is used to declare an array especially to specify more than 10 subscripts. • DIM statement causes the computer to reserve more spaces in its memory required for big arrays. • The number of subscripted variables can be increased including the DIM statement in an array program. • Syntax: Line# DIM <VariableName> (subscripted value) Hamza Mohammad Iqbal
  • 7. Error without using DIM • When you run a program of an array to store more than 10 values. In the output you got the error such like BAD subscript error in line# because the computer ordinarily reserves memory spaces for only 11 elements of an array. Hamza Mohammad Iqbal
  • 8. Two Dimensional Array • Two dimensional arrays are named the same way as one-dimensional arrays. • Elements in a two-dimensional array are commonly referred to as doubly-subscripted variables. • Format: Line# DIM (Array Name) (row,column) Hamza Mohammad Iqbal
  • 9. Filling two dimensional array • One way of filling a two dimensional array is by FOR …. NEXT nested loops. • For e.g. • 10 DIM D(4,3) • 20 FOR ROW = 1 TO 4 • 30 FOR COL = 1 TO 3 • 40 READ D(ROW,COL) • 50 NEXT COL • 60 NEXT ROW • 70 DATA 3,5,6 • 80 DATA 76,5,3 • 90 DATA 45,4,74 • 100 DATA 34,65,7 • 110 END Hamza Mohammad Iqbal
  • 10. PRINTING TWO DIMENSIONAL ARRAY • 10 DIM D(4,3) • 20 FOR ROW = 1 TO 4 • 30 FOR COL = 1 TO 3 • 40 READ D(ROW,COL) • 50 NEXT COL • 60 NEXT ROW • 70 PRINT “PRINT TWO DIMENSIONAL ARRAY” • 80 FOR ROW = 1 TO 4 • 90 FOR COL = 1 TO 3 • 100 PRINT D(ROW,COL); • 110 NEXT COL • 120 PRINT • 130 NEXT ROW • 170 DATA 3,5,6 • 180 DATA 76,5,3 • 190 DATA 45,4,74 • 200 DATA 34,65,7 • 210 END Hamza Mohammad Iqbal
  • 12. Manipulating data with Arrays • Numerous operations on data can be performed using arrays. Such as finding particular element in an array, matching elements from two arrays and sorting an array. • Important use of arrays is to store data that are used later for comparison. Hamza Mohammad Iqbal