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

PPTX
Presentation on Karnaugh Map
PPTX
Applications of cross correlation
PDF
Neural Networks
PPTX
Segment tree
PPTX
Routing algorithm
PPTX
SOP POS, Minterm and Maxterm
PPTX
Python ppt
PPTX
Array operations
Presentation on Karnaugh Map
Applications of cross correlation
Neural Networks
Segment tree
Routing algorithm
SOP POS, Minterm and Maxterm
Python ppt
Array operations

What's hot (20)

PPT
Multiplexing and spreading
PPT
Multiplexing : FDM
PPT
Submicron cmos technology
PPTX
Frequency spectrum
PPTX
Working with NS2
PPT
Arrays in c
PPTX
Digital to digital
PPTX
NumPy.pptx
PPTX
Strings in C language
PDF
List,tuple,dictionary
PPTX
Introduction to Array ppt
PDF
Basics of coding theory
PPTX
Stop-and-Wait ARQ Protocol
PPTX
Python Revision Tour.pptx class 12 python notes
PPSX
Error control
PPTX
Boolean expression org.
PPTX
PPTX
Huffman codes
PPSX
Fixed point and floating-point numbers
PDF
Arithmetic coding
Multiplexing and spreading
Multiplexing : FDM
Submicron cmos technology
Frequency spectrum
Working with NS2
Arrays in c
Digital to digital
NumPy.pptx
Strings in C language
List,tuple,dictionary
Introduction to Array ppt
Basics of coding theory
Stop-and-Wait ARQ Protocol
Python Revision Tour.pptx class 12 python notes
Error control
Boolean expression org.
Huffman codes
Fixed point and floating-point numbers
Arithmetic coding
Ad

Similar to Array in c programming (20)

PDF
PPTX
Programming in c Arrays
PDF
Array and its types and it's implemented programming Final.pdf
PPT
Arrays Basics
PPT
Array in c
PPTX
array-160309152651.pptx
PPTX
Array.pptx
PPT
uderstanding arrays and how to declare arrays
PPTX
Basic array in c programming
PPT
Presentation about arrays
PPTX
Arrays in c
PDF
Array in C full basic explanation
PPTX
PPTX
Arrays.pptx
PDF
Arrays In C
PPTX
Concepts of Arrays
PPTX
Array in C
PPTX
Arrays basics
DOCX
Programming in c Arrays
Array and its types and it's implemented programming Final.pdf
Arrays Basics
Array in c
array-160309152651.pptx
Array.pptx
uderstanding arrays and how to declare arrays
Basic array in c programming
Presentation about arrays
Arrays in c
Array in C full basic explanation
Arrays.pptx
Arrays In C
Concepts of Arrays
Array in C
Arrays basics
Ad

Recently uploaded (20)

PPTX
Institutional Correction lecture only . . .
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Classroom Observation Tools for Teachers
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
RMMM.pdf make it easy to upload and study
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
master seminar digital applications in india
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
Institutional Correction lecture only . . .
A systematic review of self-coping strategies used by university students to ...
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Final Presentation General Medicine 03-08-2024.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Microbial diseases, their pathogenesis and prophylaxis
Classroom Observation Tools for Teachers
Supply Chain Operations Speaking Notes -ICLT Program
RMMM.pdf make it easy to upload and study
FourierSeries-QuestionsWithAnswers(Part-A).pdf
GDM (1) (1).pptx small presentation for students
Microbial disease of the cardiovascular and lymphatic systems
human mycosis Human fungal infections are called human mycosis..pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
master seminar digital applications in india
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
202450812 BayCHI UCSC-SV 20250812 v17.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?

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