SlideShare a Scribd company logo
1 of 11
Sardar Vallabhbhai Patel
institute of technology
Name - Nariya Priyank
ID -16BEMEF011
Enrollment no. -160410119047
Subject -CPU
Topic -Concept of Array, One dimension
array and two dimension array
Branch -Mechanical-1
Batch -A
Introductions of array
-An array
 A single name for a collection of data values
 All of the same data type
 Subscript notation to identify one of the values
 The array is important concept and helps the
programmer in managing many variable of the
same type
Arrays can be divided into three
category
 1. Single Dimensional Array
 2. Two dimensional Array
 3. Multi dimensional Array
Some example where the concept of an
array can be used
List of product and their cost sold by a store
Test score of a class of a student
Table of a daily rainfall data
List of the costumer and their telephone data
Single Dimensional Array
Dimensional refers to the array’s size , which is how
big the array is.
A single or one dimensional array declaration has
the following form,
datatype arrayname[size];
Here, datatype defines the type of array elements,
it can be int, char, float, long int etc.
The arrayname is the name of variable which
represents the array, while size which is represents
in the [ ] symbol represents the size of the array.
Creating Arrays
 Data type array-name[size];
Example:
int num[10];
num[0]references the first element in the array.
num[9]references the last element in the array.
Graphically, array a can be represented like this.
Array elements
Index 0 1 2 3 4 5 6 7 8 9
12 45 34 2 33 65 76 8 6 67
Declaring Array Variables
 Data type array name[index];
Example:
int list[10];
char num[15];
float hat[20];
The Length of Arrays
 Once an array is created, its size is fixed. It
cannot be changed.
For Example,
int arr[10];
You can not insert any number to arr[11]
location because it is not initialized.
Two dimensional
 This type of array represents and store data in
matrix form
 The syntax for two dimensional array is :
datatype variablename [rowsize][columnsize]
 Where ,variablename represent the name of an
array ,rowsize indicate the number of rows in
table ,columnsize indicates number of columns
in an array .
 For example
Int sales[3][12];
Here , the row size is 3, so row number spans from 0 to
2,while column number spans from 0 to 11
Column
row 0 1 2 3 4 5 6 7 8 9 10 11
0
1
2
50 23 7 11 23 48 52 69 54 42 88 99
25 23 26 49 50 41 20 56 17 15 23 62
23 15 42 52 69 87 86 95 58 56 96 36
Example of Two dimension Array
Thank you

More Related Content

What's hot (20)

data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Array
ArrayArray
Array
 
Union in C programming
Union in C programmingUnion in C programming
Union in C programming
 
Arrays
ArraysArrays
Arrays
 
Array in c++
Array in c++Array in c++
Array in c++
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
Array ppt
Array pptArray ppt
Array ppt
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
Lesson 02 python keywords and identifiers
Lesson 02   python keywords and identifiersLesson 02   python keywords and identifiers
Lesson 02 python keywords and identifiers
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
Two dimensional arrays
Two dimensional arraysTwo dimensional arrays
Two dimensional arrays
 
Arrays and Strings
Arrays and Strings Arrays and Strings
Arrays and Strings
 
Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
 
Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive Data Types - Premetive and Non Premetive
Data Types - Premetive and Non Premetive
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
 
Array in c
Array in cArray in c
Array in c
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Method overriding
Method overridingMethod overriding
Method overriding
 
Pointers in C Programming
Pointers in C ProgrammingPointers in C Programming
Pointers in C Programming
 

Similar to concept of Array, 1D & 2D array (20)

lec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptxlec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptx
 
Arrays
ArraysArrays
Arrays
 
Introduction to Arrays in C
Introduction to Arrays in CIntroduction to Arrays in C
Introduction to Arrays in C
 
Array and its types and it's implemented programming Final.pdf
Array and its types and it's implemented programming Final.pdfArray and its types and it's implemented programming Final.pdf
Array and its types and it's implemented programming Final.pdf
 
Chap09
Chap09Chap09
Chap09
 
3.ArraysandPointers.pptx
3.ArraysandPointers.pptx3.ArraysandPointers.pptx
3.ArraysandPointers.pptx
 
Arrays
ArraysArrays
Arrays
 
Arrays
ArraysArrays
Arrays
 
BHARGAVIARRAY.PPT.pptx
BHARGAVIARRAY.PPT.pptxBHARGAVIARRAY.PPT.pptx
BHARGAVIARRAY.PPT.pptx
 
Learn Java Part 9
Learn Java Part 9Learn Java Part 9
Learn Java Part 9
 
Array
ArrayArray
Array
 
Array
ArrayArray
Array
 
Algo>Arrays
Algo>ArraysAlgo>Arrays
Algo>Arrays
 
Chapter 4 (Part I) - Array and Strings.pdf
Chapter 4 (Part I) - Array and Strings.pdfChapter 4 (Part I) - Array and Strings.pdf
Chapter 4 (Part I) - Array and Strings.pdf
 
Array in c
Array in cArray in c
Array in c
 
Array
ArrayArray
Array
 
Array in-c
Array in-cArray in-c
Array in-c
 
Array in c language
Array in c language Array in c language
Array in c language
 
arrays.docx
arrays.docxarrays.docx
arrays.docx
 
9781439035665 ppt ch09
9781439035665 ppt ch099781439035665 ppt ch09
9781439035665 ppt ch09
 

More from Sangani Ankur

The meaning and process of communication
The meaning and process of communicationThe meaning and process of communication
The meaning and process of communicationSangani Ankur
 
seminar for collage level
seminar for collage levelseminar for collage level
seminar for collage levelSangani Ankur
 
projection of points-engineering graphics
projection of points-engineering graphicsprojection of points-engineering graphics
projection of points-engineering graphicsSangani Ankur
 
bottom up process for nenometirial
bottom up process for nenometirialbottom up process for nenometirial
bottom up process for nenometirialSangani Ankur
 

More from Sangani Ankur (6)

The meaning and process of communication
The meaning and process of communicationThe meaning and process of communication
The meaning and process of communication
 
Ramjet engines
Ramjet enginesRamjet engines
Ramjet engines
 
Laser
LaserLaser
Laser
 
seminar for collage level
seminar for collage levelseminar for collage level
seminar for collage level
 
projection of points-engineering graphics
projection of points-engineering graphicsprojection of points-engineering graphics
projection of points-engineering graphics
 
bottom up process for nenometirial
bottom up process for nenometirialbottom up process for nenometirial
bottom up process for nenometirial
 

Recently uploaded

Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
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
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
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
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
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
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 

concept of Array, 1D & 2D array

  • 1. Sardar Vallabhbhai Patel institute of technology Name - Nariya Priyank ID -16BEMEF011 Enrollment no. -160410119047 Subject -CPU Topic -Concept of Array, One dimension array and two dimension array Branch -Mechanical-1 Batch -A
  • 2. Introductions of array -An array  A single name for a collection of data values  All of the same data type  Subscript notation to identify one of the values  The array is important concept and helps the programmer in managing many variable of the same type
  • 3. Arrays can be divided into three category  1. Single Dimensional Array  2. Two dimensional Array  3. Multi dimensional Array Some example where the concept of an array can be used List of product and their cost sold by a store Test score of a class of a student Table of a daily rainfall data List of the costumer and their telephone data
  • 4. Single Dimensional Array Dimensional refers to the array’s size , which is how big the array is. A single or one dimensional array declaration has the following form, datatype arrayname[size]; Here, datatype defines the type of array elements, it can be int, char, float, long int etc. The arrayname is the name of variable which represents the array, while size which is represents in the [ ] symbol represents the size of the array.
  • 5. Creating Arrays  Data type array-name[size]; Example: int num[10]; num[0]references the first element in the array. num[9]references the last element in the array. Graphically, array a can be represented like this. Array elements Index 0 1 2 3 4 5 6 7 8 9 12 45 34 2 33 65 76 8 6 67
  • 6. Declaring Array Variables  Data type array name[index]; Example: int list[10]; char num[15]; float hat[20];
  • 7. The Length of Arrays  Once an array is created, its size is fixed. It cannot be changed. For Example, int arr[10]; You can not insert any number to arr[11] location because it is not initialized.
  • 8. Two dimensional  This type of array represents and store data in matrix form  The syntax for two dimensional array is : datatype variablename [rowsize][columnsize]  Where ,variablename represent the name of an array ,rowsize indicate the number of rows in table ,columnsize indicates number of columns in an array .
  • 9.  For example Int sales[3][12]; Here , the row size is 3, so row number spans from 0 to 2,while column number spans from 0 to 11 Column row 0 1 2 3 4 5 6 7 8 9 10 11 0 1 2 50 23 7 11 23 48 52 69 54 42 88 99 25 23 26 49 50 41 20 56 17 15 23 62 23 15 42 52 69 87 86 95 58 56 96 36
  • 10. Example of Two dimension Array