SlideShare a Scribd company logo
1 of 11
 What is Array. 
 Advantages & Uses of Array. 
 Array Declaration 
 Array Initialization. 
Prepared by M.A.C
 An array is a group of consecutive memory location 
with same name and type. 
 Simple variable is a single memory location with a 
unique name and type. 
 The memory locations in the array are known as 
element of array. 
 The total number of elements in the array is called its 
length.
 Some advantages of arrays are as following: 
 Arrays can store a large number of values with single 
name. 
 Arrays are used to process many values easily and 
quickly. 
 The values stored in an array can be stored easily. 
 A search process can be applied on arrays easily
 A type of array in which all elements are arranged in 
the form of list is known as one dimensional array. 
 It consists of one column or one row. 
 The process of specifying array name length and data 
type is called array declaration.
 Data_Type Identifier[Length]; 
 Data Type : 
It indicates data type of the values to be stored in the 
array. 
 Identifier : 
It indicates the name of array. 
 Length : 
It indicates total number of elements in the array.
 int marks[5]; 
index of element 0 1 2 3 4 
Name of array marks
 The process of assigning values to array elements at 
the time of array declaration is called array 
initialization. 
 The values are seprated with commas and enclosed 
within braces. 
 A syntax error occurs if the values in braces are more 
than the length of array. 
 If the number of initial values is less than the array size 
the remaining array elements are initialized to zero.
Type identifier[Length]={List of values}; 
Example 
Int marks[5]={70,54,82,96,49}; 
Index of elements 0 1 2 3 4 
Name of array marks 7 0 54 82 96 49
 The process of input and output with array is similar to 
the input and output with simple variables. 
 The cin object is used to input values in the arrays. 
 The cout object is used to display values of array.
Array
Array

More Related Content

What's hot (20)

Structure in C
Structure in CStructure in C
Structure in C
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Python strings
Python stringsPython strings
Python strings
 
Strings
StringsStrings
Strings
 
Presentation on array
Presentation on array Presentation on array
Presentation on array
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Array
ArrayArray
Array
 
Array in c
Array in cArray in c
Array in c
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
Arrays
ArraysArrays
Arrays
 
Function overloading(c++)
Function overloading(c++)Function overloading(c++)
Function overloading(c++)
 
Arrays
ArraysArrays
Arrays
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
 
Pointers C programming
Pointers  C programmingPointers  C programming
Pointers C programming
 
Array
ArrayArray
Array
 
Structure and union
Structure and unionStructure and union
Structure and union
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : Arrays
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 

Similar to Array (20)

Arrays
ArraysArrays
Arrays
 
Presentation of array
Presentation of arrayPresentation of array
Presentation of array
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
Arrays accessing using for loops
Arrays accessing using for loopsArrays accessing using for loops
Arrays accessing using for loops
 
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
 
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
 
Arrays
ArraysArrays
Arrays
 
Lecture 2.8 Arrays.pdf
Lecture 2.8 Arrays.pdfLecture 2.8 Arrays.pdf
Lecture 2.8 Arrays.pdf
 
OOPs with java
OOPs with javaOOPs with java
OOPs with java
 
Ap Power Point Chpt6
Ap Power Point Chpt6Ap Power Point Chpt6
Ap Power Point Chpt6
 
Arrays and Strings
Arrays and Strings Arrays and Strings
Arrays and Strings
 
Arrays
ArraysArrays
Arrays
 
arrays.docx
arrays.docxarrays.docx
arrays.docx
 
Module 7 : Arrays
Module 7 : ArraysModule 7 : Arrays
Module 7 : Arrays
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
Array in c
Array in cArray in c
Array in c
 
Array lecture
Array lectureArray lecture
Array lecture
 

Recently uploaded

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
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
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 

Recently uploaded (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
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
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

Array

  • 1.  What is Array.  Advantages & Uses of Array.  Array Declaration  Array Initialization. Prepared by M.A.C
  • 2.  An array is a group of consecutive memory location with same name and type.  Simple variable is a single memory location with a unique name and type.  The memory locations in the array are known as element of array.  The total number of elements in the array is called its length.
  • 3.  Some advantages of arrays are as following:  Arrays can store a large number of values with single name.  Arrays are used to process many values easily and quickly.  The values stored in an array can be stored easily.  A search process can be applied on arrays easily
  • 4.  A type of array in which all elements are arranged in the form of list is known as one dimensional array.  It consists of one column or one row.  The process of specifying array name length and data type is called array declaration.
  • 5.  Data_Type Identifier[Length];  Data Type : It indicates data type of the values to be stored in the array.  Identifier : It indicates the name of array.  Length : It indicates total number of elements in the array.
  • 6.  int marks[5]; index of element 0 1 2 3 4 Name of array marks
  • 7.  The process of assigning values to array elements at the time of array declaration is called array initialization.  The values are seprated with commas and enclosed within braces.  A syntax error occurs if the values in braces are more than the length of array.  If the number of initial values is less than the array size the remaining array elements are initialized to zero.
  • 8. Type identifier[Length]={List of values}; Example Int marks[5]={70,54,82,96,49}; Index of elements 0 1 2 3 4 Name of array marks 7 0 54 82 96 49
  • 9.  The process of input and output with array is similar to the input and output with simple variables.  The cin object is used to input values in the arrays.  The cout object is used to display values of array.

Editor's Notes

  1. Arrays An array is a group of consecutive memory location with same and same type.Simple variable is a single memory location with a unique name and a type. The memory locations in the array are known as elements of array. The total number of elements in the array is called its length.