SlideShare a Scribd company logo
1 of 9
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 (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

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
 
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++
 
Array
ArrayArray
Array
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

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