SlideShare a Scribd company logo
1 of 21
GROUP MEMBERS:
Arrays
WHAT IS ARRAY?
 An array is a group of consecutive memory
locations with same name and data type.
 The objects in an array are called elements of array.
The total number of elements in an array is called
length.
 The element of an array is accessed by its subscript
value or index value.
ADVANTAGES OF ARRAYS
 Arrays are used to process a large amount of data of
same type.
 Arrays are used to reduce the size of program.
 Arrays can store many values easily and quickly.
 The searches process can be applied on array easily.
TYPES OF ARRAYS
1. One-dimensional arrays
2. Multi-dimensional arrays
ONE D-ARRAY
 One dimensional array is also called a list or linear
array. It consist of only one column or one row.
 For example
the temperature of each hour of a day is
stored in an array. The name of array is “temp” and its
elements are temp[0],temp[1],………….temp[23].
DECLARATION OF 1-D ARRAY
 Defining the name of array, its types and
total numbers of elements of an array is called
declaring of the array.
 Syntax
data type array_name [n];
“n” represents the total number of elements of array.
 e.g
Int xyz[5];
1-D ARRAY INITIALIZATION
 The process of assigning a values to array element at the
time of array declaration is called initialization of array.
 Syntax
data type identifier[n]={list of values};
 e.g
int mark[4]={70,56,84,64,23};
int arr[2]={‘p’,’a’,’k’}
 Initializing values may be constant or character
type.
SEARCHING IN AN ARRAY
 The process of finding the required data in array.
Searching become more important when length of
array is very large.
 There are two techniques for searching:
1. Sequential search
2. Binary search
SEQUENTIAL SEARCH
 It is also called linear or serial search. It follow the
following steps to search value:
1. Visit the first element of array and compare its with required value.
2. If the value of array matches with the desired value then search is
complete.
3. If value of array does not match then move to next element and
repeat the same process.
BINARY SEARCH
1. It is a quicker method to search value in array. But it can only search
for sorted array. Following steps are used:
2. It locate the middle element of array and compare it with desired
value.
3. If they are equal the search is complete.
4. If they are not equal, it reduce the search half an array.
5. If the required value is less than the middle value then it search for
first middle half otherwise second half.
6. If required number is not found then loop is complete without
successful search.
SORTING ARRAYS
 The process of arranging the values in a particular
order. An array can be sorted in two ways:
a) Ascending order e.g 23, 34,56,78
b) Descending order e.g 78,56,34,23
TECHNIQUE OF SORTING ARRAY
There are two technique of sorting of array
1. Selection sort
2. Bubble sort
SELECTION SORT
It is a technique that sort an array. It selects an
element in array and move it to its proper position.
It works as follow:.
1. Find the minimum value in the list.
2. Swap it with value at first position.
3. Sorts the remainder of the list excluding the first value.
BUBBLE SORT
 It is also known as exchange sort. It repeatedly
visits the array and compare two values at a time.it
works as follow:
1) It compare the adjacent element. If the first is greater
than second, swaps them.
2) Repeat this for each pair of adjacent element, starting
with the first two and ending with last two.
3) Keep repeating for one fewer element each time until
there is no pairs to compare.
TWO D-ARRAY
 It is considered as table that consist of rows and
columns. Each element in an array is referred with
the help of two indexes. One indicates row and
second column.
DECLARING 2-D ARRAY
Syntax:
data_type identifier[row][column];
e.g:
int arr[4][3];
0,0 0.1 0,2
1,0 1,1 1,2
2,0 2,1 2,2
3,0 3,1 3,2
2-D INITILIZATION
It can also be initialized at the time of declaration. It
can be performed by assigning the initial values in
braces separated by commas.
Some important points:
1) The elements of each rows are enclosed within the braces
and separated by commas.
2) All rows are enclosed within braces.
3) For number arrays, if all elements are not specified , the un-
specified element are initialized by zero.
2 D ARRAY
for example:
Int arr[4][3]={{12,5,22},
{95,3,41},
{77,6,53}
{84,59,62}}
12 5 22
95 3 41
77 6 53
84 59 62
Arrays

More Related Content

What's hot (18)

Circular linked list
Circular linked listCircular linked list
Circular linked list
 
Data Structure
Data StructureData Structure
Data Structure
 
4.1 sequentioal search
4.1 sequentioal search4.1 sequentioal search
4.1 sequentioal search
 
Data structures2
Data structures2Data structures2
Data structures2
 
Searching,sorting
Searching,sortingSearching,sorting
Searching,sorting
 
searching
searchingsearching
searching
 
Insertion and Redix Sort
Insertion and Redix SortInsertion and Redix Sort
Insertion and Redix Sort
 
lecture 9
lecture 9lecture 9
lecture 9
 
Sorting
SortingSorting
Sorting
 
Excel
ExcelExcel
Excel
 
Link list assi
Link list assiLink list assi
Link list assi
 
Join
JoinJoin
Join
 
List data structure
List data structure List data structure
List data structure
 
MS excel functions
MS excel functionsMS excel functions
MS excel functions
 
Doubly circular linked list
Doubly circular linked listDoubly circular linked list
Doubly circular linked list
 
Workshop 04 Review
Workshop 04 ReviewWorkshop 04 Review
Workshop 04 Review
 
Javascript ADT - List
Javascript   ADT - ListJavascript   ADT - List
Javascript ADT - List
 
Sorting and Its Types
Sorting and Its TypesSorting and Its Types
Sorting and Its Types
 

Viewers also liked

до уроку у цирку
до уроку у цирку до уроку у цирку
до уроку у цирку pr1nc1k
 
Resume_Larry_Oviatt
Resume_Larry_OviattResume_Larry_Oviatt
Resume_Larry_OviattLarry Oviatt
 
Presentación negativo positivo
Presentación negativo positivoPresentación negativo positivo
Presentación negativo positivopatricia campos
 
Jacob Peled - Clemson Tire Conf 2013 Presentation "Aircraft Tire Production-N...
Jacob Peled - Clemson Tire Conf 2013 Presentation "Aircraft Tire Production-N...Jacob Peled - Clemson Tire Conf 2013 Presentation "Aircraft Tire Production-N...
Jacob Peled - Clemson Tire Conf 2013 Presentation "Aircraft Tire Production-N...PelmarGroup
 
Land use land cover mapping for smart village using gis
Land use land cover mapping for smart village using gisLand use land cover mapping for smart village using gis
Land use land cover mapping for smart village using gisSumit Yeole
 
O principal da vida
O principal da vidaO principal da vida
O principal da vidaLucio Borges
 
Sabotagem programa espacial_brasileiro
Sabotagem programa espacial_brasileiroSabotagem programa espacial_brasileiro
Sabotagem programa espacial_brasileiroLucio Borges
 

Viewers also liked (11)

до уроку у цирку
до уроку у цирку до уроку у цирку
до уроку у цирку
 
How To Build A Financial Plan?
How To Build A Financial Plan?How To Build A Financial Plan?
How To Build A Financial Plan?
 
Resume_Larry_Oviatt
Resume_Larry_OviattResume_Larry_Oviatt
Resume_Larry_Oviatt
 
Presentación negativo positivo
Presentación negativo positivoPresentación negativo positivo
Presentación negativo positivo
 
Jacob Peled - Clemson Tire Conf 2013 Presentation "Aircraft Tire Production-N...
Jacob Peled - Clemson Tire Conf 2013 Presentation "Aircraft Tire Production-N...Jacob Peled - Clemson Tire Conf 2013 Presentation "Aircraft Tire Production-N...
Jacob Peled - Clemson Tire Conf 2013 Presentation "Aircraft Tire Production-N...
 
Vocales y rompecabezas
Vocales y rompecabezasVocales y rompecabezas
Vocales y rompecabezas
 
Solar cars
Solar carsSolar cars
Solar cars
 
Aircraft Wheel and breaks
Aircraft Wheel and breaksAircraft Wheel and breaks
Aircraft Wheel and breaks
 
Land use land cover mapping for smart village using gis
Land use land cover mapping for smart village using gisLand use land cover mapping for smart village using gis
Land use land cover mapping for smart village using gis
 
O principal da vida
O principal da vidaO principal da vida
O principal da vida
 
Sabotagem programa espacial_brasileiro
Sabotagem programa espacial_brasileiroSabotagem programa espacial_brasileiro
Sabotagem programa espacial_brasileiro
 

Similar to Arrays

Similar to Arrays (20)

Array ppt
Array pptArray ppt
Array ppt
 
Array.pdf
Array.pdfArray.pdf
Array.pdf
 
Arrays
ArraysArrays
Arrays
 
Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
 
arrayppt.pptx
arrayppt.pptxarrayppt.pptx
arrayppt.pptx
 
arrays in c
arrays in carrays in c
arrays in c
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
Presentation of array
Presentation of arrayPresentation of array
Presentation of array
 
DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptx
 
Data Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingData Structures_ Sorting & Searching
Data Structures_ Sorting & Searching
 
Unit v data structure-converted
Unit  v data structure-convertedUnit  v data structure-converted
Unit v data structure-converted
 
Ap Power Point Chpt6
Ap Power Point Chpt6Ap Power Point Chpt6
Ap Power Point Chpt6
 
DSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notesDSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notes
 
Sorting
SortingSorting
Sorting
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 
advanced searching and sorting.pdf
advanced searching and sorting.pdfadvanced searching and sorting.pdf
advanced searching and sorting.pdf
 
Data structures arrays
Data structures   arraysData structures   arrays
Data structures arrays
 
Searching Sorting
Searching SortingSearching Sorting
Searching Sorting
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sorting
 
Algorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptxAlgorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptx
 

Recently uploaded

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

Arrays

  • 1.
  • 4. WHAT IS ARRAY?  An array is a group of consecutive memory locations with same name and data type.  The objects in an array are called elements of array. The total number of elements in an array is called length.  The element of an array is accessed by its subscript value or index value.
  • 5. ADVANTAGES OF ARRAYS  Arrays are used to process a large amount of data of same type.  Arrays are used to reduce the size of program.  Arrays can store many values easily and quickly.  The searches process can be applied on array easily.
  • 6. TYPES OF ARRAYS 1. One-dimensional arrays 2. Multi-dimensional arrays
  • 7. ONE D-ARRAY  One dimensional array is also called a list or linear array. It consist of only one column or one row.  For example the temperature of each hour of a day is stored in an array. The name of array is “temp” and its elements are temp[0],temp[1],………….temp[23].
  • 8. DECLARATION OF 1-D ARRAY  Defining the name of array, its types and total numbers of elements of an array is called declaring of the array.  Syntax data type array_name [n]; “n” represents the total number of elements of array.  e.g Int xyz[5];
  • 9. 1-D ARRAY INITIALIZATION  The process of assigning a values to array element at the time of array declaration is called initialization of array.  Syntax data type identifier[n]={list of values};  e.g int mark[4]={70,56,84,64,23}; int arr[2]={‘p’,’a’,’k’}  Initializing values may be constant or character type.
  • 10. SEARCHING IN AN ARRAY  The process of finding the required data in array. Searching become more important when length of array is very large.  There are two techniques for searching: 1. Sequential search 2. Binary search
  • 11. SEQUENTIAL SEARCH  It is also called linear or serial search. It follow the following steps to search value: 1. Visit the first element of array and compare its with required value. 2. If the value of array matches with the desired value then search is complete. 3. If value of array does not match then move to next element and repeat the same process.
  • 12. BINARY SEARCH 1. It is a quicker method to search value in array. But it can only search for sorted array. Following steps are used: 2. It locate the middle element of array and compare it with desired value. 3. If they are equal the search is complete. 4. If they are not equal, it reduce the search half an array. 5. If the required value is less than the middle value then it search for first middle half otherwise second half. 6. If required number is not found then loop is complete without successful search.
  • 13. SORTING ARRAYS  The process of arranging the values in a particular order. An array can be sorted in two ways: a) Ascending order e.g 23, 34,56,78 b) Descending order e.g 78,56,34,23
  • 14. TECHNIQUE OF SORTING ARRAY There are two technique of sorting of array 1. Selection sort 2. Bubble sort
  • 15. SELECTION SORT It is a technique that sort an array. It selects an element in array and move it to its proper position. It works as follow:. 1. Find the minimum value in the list. 2. Swap it with value at first position. 3. Sorts the remainder of the list excluding the first value.
  • 16. BUBBLE SORT  It is also known as exchange sort. It repeatedly visits the array and compare two values at a time.it works as follow: 1) It compare the adjacent element. If the first is greater than second, swaps them. 2) Repeat this for each pair of adjacent element, starting with the first two and ending with last two. 3) Keep repeating for one fewer element each time until there is no pairs to compare.
  • 17. TWO D-ARRAY  It is considered as table that consist of rows and columns. Each element in an array is referred with the help of two indexes. One indicates row and second column.
  • 18. DECLARING 2-D ARRAY Syntax: data_type identifier[row][column]; e.g: int arr[4][3]; 0,0 0.1 0,2 1,0 1,1 1,2 2,0 2,1 2,2 3,0 3,1 3,2
  • 19. 2-D INITILIZATION It can also be initialized at the time of declaration. It can be performed by assigning the initial values in braces separated by commas. Some important points: 1) The elements of each rows are enclosed within the braces and separated by commas. 2) All rows are enclosed within braces. 3) For number arrays, if all elements are not specified , the un- specified element are initialized by zero.
  • 20. 2 D ARRAY for example: Int arr[4][3]={{12,5,22}, {95,3,41}, {77,6,53} {84,59,62}} 12 5 22 95 3 41 77 6 53 84 59 62