SlideShare a Scribd company logo
Presentedby:
Mk dheeran
Teach guru
Introduction to
Arrays
What is an array ?
✘ Array is a collection of similar data items are
stored under a common name.
✘ It is a continuous memory location.
✘ The lowest address corresponds to the first
element and largest address to the last element.
✘ Example:
a[3]={1,2,3}
3
Classification of arrays:
 Depending upon the number of subscripts used,
arrays are classified into three types
1. One-dimensional array
2. Two- dimensional array
3. Multi – dimensional array
4
One Dimensional Array:
Syntax:
data_typevariable_name[dimensional/size of an array];
Example:
a[5]={1,2,3,4,5}
5
Name a[0] a[1] a[2] a[3] a[4]
Value 1 2 3 4 5
Address 1000 1001 1002 1003 1004
Initialization:
An array can be initialized at
I. compile time
II. run time
✘ After declaration ,the array elements must be
initialized otherwise they hold garbage value.
6
1.Compile time initialization:
 Initialization at the time of the declaration is known as compile time
initialization.
Syntax:
data_typevariable_name[dimensional/size of an array]={value1, value2,…value n};
Example:
• int a[5]={1,2,3,4,5};
• int b[]={1,2,3,4,5};
• char name[]={‘A’,’B’,’C’};
7
2. Run time initialization:
 When the array have large number of elements then the
array elements can be initialize at run time.
Syntax:
scanf(“format specifier”, &variablename[size] );
8
9
Thank you..

More Related Content

What's hot

Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
sandhya yadav
 
Arrays in c language
Arrays in c languageArrays in c language
Arrays in c language
tanmaymodi4
 
arrays in c
arrays in carrays in c
arrays in c
vidhi mehta
 
Array in c
Array in cArray in c
Array in c
Ravi Gelani
 
Arrays in c
Arrays in cArrays in c
Arrays in c
Jeeva Nanthini
 
Array in c
Array in cArray in c
Array in c
AnIsh Kumar
 
Arrays in c
Arrays in cArrays in c
Arrays in c
vampugani
 
Array in-c
Array in-cArray in-c
Array in-c
Samsil Arefin
 
Array in C
Array in CArray in C
Array in C
adityas29
 
Array
ArrayArray
Array
ArrayArray
Array in C
Array in CArray in C
Array in C
Kamal Acharya
 
ARRAY
ARRAYARRAY
ARRAY
ayush raj
 
Array in c++
Array in c++Array in c++
Array in c++
Mahesha Mano
 
Array C programming
Array C programmingArray C programming
Array C programming
Prionto Abdullah
 
C++ programming (Array)
C++ programming (Array)C++ programming (Array)
C++ programming (Array)
طارق بالحارث
 
Array in c language
Array in c languageArray in c language
Array in c language
umesh patil
 

What's hot (20)

Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 
Arrays in c language
Arrays in c languageArrays in c language
Arrays in c language
 
Numeric Arrays [6]
Numeric Arrays [6]Numeric Arrays [6]
Numeric Arrays [6]
 
arrays in c
arrays in carrays in c
arrays in c
 
Array in c
Array in cArray in c
Array in c
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Array in c
Array in cArray in c
Array in c
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Array in-c
Array in-cArray in-c
Array in-c
 
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
ArrayArray
Array
 
Array in C
Array in CArray in C
Array in C
 
ARRAY
ARRAYARRAY
ARRAY
 
Array in c++
Array in c++Array in c++
Array in c++
 
Array C programming
Array C programmingArray C programming
Array C programming
 
C++ programming (Array)
C++ programming (Array)C++ programming (Array)
C++ programming (Array)
 
Arrays
ArraysArrays
Arrays
 
Array in c language
Array in c languageArray in c language
Array in c language
 

Similar to Array in c programming

Arrays
ArraysArrays
Arrays
ViniVini48
 
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
 
Arrays
ArraysArrays
Arrays
swathi reddy
 
Arrays accessing using for loops
Arrays accessing using for loopsArrays accessing using for loops
Arrays accessing using for loops
sangrampatil81
 
Arrays declartion and initialization
Arrays declartion and initializationArrays declartion and initialization
Arrays declartion and initialization
sangrampatil81
 
Arrays in C
Arrays in CArrays in C
Arrays in C
sangrampatil81
 
Arrays
ArraysArrays
PPt. on An _Array in C
PPt. on An _Array in CPPt. on An _Array in C
PPt. on An _Array in C
RohitAgrawal119182
 
Presentation of array
Presentation of arrayPresentation of array
Presentation of array
Shamim Hossain
 
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
KirubelWondwoson1
 
One Dimensional Array
One Dimensional Array One Dimensional Array
One Dimensional Array
dincyjain
 
Arrays and Strings
Arrays and Strings Arrays and Strings
Arrays and Strings
Dr.Subha Krishna
 
arrays.pptx
arrays.pptxarrays.pptx
arrays.pptx
MANEESHValluru
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
Maliha Mehr
 
Array 2 hina
Array 2 hina Array 2 hina
Array 2 hina
heena94
 
Introduction to Array & Structure & Basic Algorithms.pptx
Introduction to Array & Structure & Basic Algorithms.pptxIntroduction to Array & Structure & Basic Algorithms.pptx
Introduction to Array & Structure & Basic Algorithms.pptx
MrNikhilMohanShinde
 
Arrays in c
Arrays in cArrays in c
Arrays in c
CHANDAN KUMAR
 
Arrays in c unit iii chapter 1 mrs.sowmya jyothi
Arrays in c unit iii chapter 1 mrs.sowmya jyothiArrays in c unit iii chapter 1 mrs.sowmya jyothi
Arrays in c unit iii chapter 1 mrs.sowmya jyothi
Sowmya Jyothi
 
Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
Awais Alam
 

Similar to Array in c programming (20)

Arrays
ArraysArrays
Arrays
 
Mesics lecture 8 arrays in 'c'
Mesics lecture 8   arrays in 'c'Mesics lecture 8   arrays in 'c'
Mesics lecture 8 arrays in 'c'
 
Arrays
ArraysArrays
Arrays
 
Arrays accessing using for loops
Arrays accessing using for loopsArrays accessing using for loops
Arrays accessing using for loops
 
Arrays declartion and initialization
Arrays declartion and initializationArrays declartion and initialization
Arrays declartion and initialization
 
Arrays in C
Arrays in CArrays in C
Arrays in C
 
arrays.docx
arrays.docxarrays.docx
arrays.docx
 
Arrays
ArraysArrays
Arrays
 
PPt. on An _Array in C
PPt. on An _Array in CPPt. on An _Array in C
PPt. on An _Array in C
 
Presentation of array
Presentation of arrayPresentation of array
Presentation of array
 
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
 
One Dimensional Array
One Dimensional Array One Dimensional Array
One Dimensional Array
 
Arrays and Strings
Arrays and Strings Arrays and Strings
Arrays and Strings
 
arrays.pptx
arrays.pptxarrays.pptx
arrays.pptx
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
Array 2 hina
Array 2 hina Array 2 hina
Array 2 hina
 
Introduction to Array & Structure & Basic Algorithms.pptx
Introduction to Array & Structure & Basic Algorithms.pptxIntroduction to Array & Structure & Basic Algorithms.pptx
Introduction to Array & Structure & Basic Algorithms.pptx
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Arrays in c unit iii chapter 1 mrs.sowmya jyothi
Arrays in c unit iii chapter 1 mrs.sowmya jyothiArrays in c unit iii chapter 1 mrs.sowmya jyothi
Arrays in c unit iii chapter 1 mrs.sowmya jyothi
 
Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
 

Recently uploaded

The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Fresher’s Quiz 2023 at GMC Nizamabad.pptx
Fresher’s Quiz 2023 at GMC Nizamabad.pptxFresher’s Quiz 2023 at GMC Nizamabad.pptx
Fresher’s Quiz 2023 at GMC Nizamabad.pptx
SriSurya50
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 

Recently uploaded (20)

The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Fresher’s Quiz 2023 at GMC Nizamabad.pptx
Fresher’s Quiz 2023 at GMC Nizamabad.pptxFresher’s Quiz 2023 at GMC Nizamabad.pptx
Fresher’s Quiz 2023 at GMC Nizamabad.pptx
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 

Array in c programming

  • 3. What is an array ? ✘ Array is a collection of similar data items are stored under a common name. ✘ It is a continuous memory location. ✘ The lowest address corresponds to the first element and largest address to the last element. ✘ Example: a[3]={1,2,3} 3
  • 4. Classification of arrays:  Depending upon the number of subscripts used, arrays are classified into three types 1. One-dimensional array 2. Two- dimensional array 3. Multi – dimensional array 4
  • 5. One Dimensional Array: Syntax: data_typevariable_name[dimensional/size of an array]; Example: a[5]={1,2,3,4,5} 5 Name a[0] a[1] a[2] a[3] a[4] Value 1 2 3 4 5 Address 1000 1001 1002 1003 1004
  • 6. Initialization: An array can be initialized at I. compile time II. run time ✘ After declaration ,the array elements must be initialized otherwise they hold garbage value. 6
  • 7. 1.Compile time initialization:  Initialization at the time of the declaration is known as compile time initialization. Syntax: data_typevariable_name[dimensional/size of an array]={value1, value2,…value n}; Example: • int a[5]={1,2,3,4,5}; • int b[]={1,2,3,4,5}; • char name[]={‘A’,’B’,’C’}; 7
  • 8. 2. Run time initialization:  When the array have large number of elements then the array elements can be initialize at run time. Syntax: scanf(“format specifier”, &variablename[size] ); 8