SlideShare a Scribd company logo
1 of 18
Arrays In C
Definition
 An array is a data structure which
stores homogeneous(similar)data
items.
 An array variable is used to store
more than one data item of same data
type at contiguous memory locations.
Example:
 C array is beneficial if you have to store
similar elements.
 Suppose you have to store marks of 50
students, one way to do this is allotting 50
variables.
 So it will be typical and hard to manage.
For example we can not access the value
of these variables with only 1 or 2 lines of
code.
 Another way to do this is array. By using
array, we can access the elements easily.
Only few lines of code is required to
access the elements of array.
Advantage of C Array
1) Code Optimization: Less code to
the access the data.
2) Easy to traverse data: By using the
for loop, we can retrieve the elements
of an array easily.
3) Easy to sort data: To sort the
elements of array, we need a few lines
of code only.
4) Random Access: We can access
any element randomly using the array.
Disadvantage of C Array
1) Fixed Size: Whatever size, we define
at the time of declaration of array, we
can't exceed the limit. So, it doesn't
grow the size dynamically like
LinkedList
Array Terminology
Array variable is composed with the following
terms:
 Size:total number of elements in an array
 Type: data type of declared array.
 Base:address of the first element of the
array.
 Index:Location or index value of array
element.
 Range:Value from lower bound to upper
bound.
 Word:indicates the space required for an
element.
Declaration of C Array
when array size is given:
 We can declare an array in the c
language in the following way:
 the example to declare array:
 Here, int is the data_type, marks is
the array_name and 5 is
the array_size.
Declaration of C Array
when array size is not known before
compilation:
data type array_name [];
//size will depend upon the elements
entered by user at run time.
Example:
int a[];
Initialization of C Array
At the time of declaration:
 A simple way to initialize array is by
index.
 array index starts from 0 and ends
with [SIZE - 1].
 int
a[5]={10,20,30,40,50}
Taking input from the user:
void main()
{
int a[5];
for(int i=0;i<5;i++)
{ to take input
printf(“enter the array element”); from the
user
scanf(“%d”,&a[i]);
}
for(int i=0;i<5;i++)
{ to display
output
printf(“the array is: %d”,a[i]); to the user
}
}
C array example
C Array: Declaration with
Initialization
 We can initialize the c array at the
time of declaration.
 In such case, there is no requirement
to define size. So it can also be
written as the following code.
C array example:
Two dimensional Array
 The two dimensional array in C
language is represented in the form of
rows and columns, also known as
matrix.
 It is also known as array of
arrays or list of arrays.
 The two dimensional, three
dimensional or other dimensional
arrays are also known
as multidimensional arrays.
Declaration of two dimensional
Array in C
 We can declare an array in the C
language in the following way:
 A simple example to declare two
dimensional array:
 Here, 4 is the row number and 3 is
the column number.
Initialization of 2D Array in C
While declaring it:
Taking input from the user:
Two dimensional array example
in C
int a[3][3];
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
printf(“enter the arary”); Taking input
scanf(“%d”,&a[i][j]);
}
}
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++) Giving output
{

More Related Content

What's hot (20)

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
 
Programming in c arrays
Programming in c   arraysProgramming in c   arrays
Programming in c arrays
 
arrays in c
arrays in carrays in c
arrays in c
 
Presentation on array
Presentation on array Presentation on array
Presentation on array
 
Array
ArrayArray
Array
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Array in c programming
Array in c programmingArray in c programming
Array in c programming
 
Array C programming
Array C programmingArray C programming
Array C programming
 
C++ lecture 04
C++ lecture 04C++ lecture 04
C++ lecture 04
 
C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : Arrays
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Arrays
ArraysArrays
Arrays
 
Array in c++
Array in c++Array in c++
Array in c++
 
Arrays Basics
Arrays BasicsArrays Basics
Arrays Basics
 
C++ programming (Array)
C++ programming (Array)C++ programming (Array)
C++ programming (Array)
 
Arrays in c language
Arrays in c languageArrays in c language
Arrays in c language
 
SPL 10 | One Dimensional Array in C
SPL 10 | One Dimensional Array in CSPL 10 | One Dimensional Array in C
SPL 10 | One Dimensional Array in C
 

Similar to Arrays in c v1 09102017

Similar to Arrays in c v1 09102017 (20)

Functions, Strings ,Storage classes in C
 Functions, Strings ,Storage classes in C Functions, Strings ,Storage classes in C
Functions, Strings ,Storage classes in C
 
Arrays & Strings
Arrays & StringsArrays & Strings
Arrays & Strings
 
Arrays-Computer programming
Arrays-Computer programmingArrays-Computer programming
Arrays-Computer programming
 
Arrays.pptx
 Arrays.pptx Arrays.pptx
Arrays.pptx
 
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
 
Arrays
ArraysArrays
Arrays
 
Arrays
ArraysArrays
Arrays
 
Cunit3.pdf
Cunit3.pdfCunit3.pdf
Cunit3.pdf
 
Break and continue in C
Break and continue in C Break and continue in C
Break and continue in C
 
Arrays accessing using for loops
Arrays accessing using for loopsArrays accessing using for loops
Arrays accessing using for loops
 
C# Array.pptx
C# Array.pptxC# Array.pptx
C# Array.pptx
 
Introduction to Arrays in C
Introduction to Arrays in CIntroduction to Arrays in C
Introduction to Arrays in C
 
Arrays
ArraysArrays
Arrays
 
arrays.docx
arrays.docxarrays.docx
arrays.docx
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
C Programming Unit-3
C Programming Unit-3C Programming Unit-3
C Programming Unit-3
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
CP Handout#7
CP Handout#7CP Handout#7
CP Handout#7
 
Programming fundamentals week 12.pptx
Programming fundamentals week 12.pptxProgramming fundamentals week 12.pptx
Programming fundamentals week 12.pptx
 
Break and Continue Statement in C Programming
Break and Continue Statement in C ProgrammingBreak and Continue Statement in C Programming
Break and Continue Statement in C Programming
 

More from Tanmay Modi

Preprocessor directives in c laguage
Preprocessor directives in c laguagePreprocessor directives in c laguage
Preprocessor directives in c laguageTanmay Modi
 
Pointers in c language
Pointers in c languagePointers in c language
Pointers in c languageTanmay Modi
 
Loops in c language
Loops in c languageLoops in c language
Loops in c languageTanmay Modi
 
Generations of computers
Generations of computersGenerations of computers
Generations of computersTanmay Modi
 
Storage classes in c language
Storage classes in c languageStorage classes in c language
Storage classes in c languageTanmay Modi
 
Union in c language
Union in c languageUnion in c language
Union in c languageTanmay Modi
 
Structures in c language
Structures in c languageStructures in c language
Structures in c languageTanmay Modi
 
Operators inc c language
Operators inc c languageOperators inc c language
Operators inc c languageTanmay Modi
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c languageTanmay Modi
 
Dynamic memory allocation in c language
Dynamic memory allocation in c languageDynamic memory allocation in c language
Dynamic memory allocation in c languageTanmay Modi
 
Decision statements in c laguage
Decision statements in c laguageDecision statements in c laguage
Decision statements in c laguageTanmay Modi
 

More from Tanmay Modi (12)

Preprocessor directives in c laguage
Preprocessor directives in c laguagePreprocessor directives in c laguage
Preprocessor directives in c laguage
 
Pointers in c language
Pointers in c languagePointers in c language
Pointers in c language
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
Generations of computers
Generations of computersGenerations of computers
Generations of computers
 
Storage classes in c language
Storage classes in c languageStorage classes in c language
Storage classes in c language
 
Union in c language
Union in c languageUnion in c language
Union in c language
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
 
Operators inc c language
Operators inc c languageOperators inc c language
Operators inc c language
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c language
 
Dynamic memory allocation in c language
Dynamic memory allocation in c languageDynamic memory allocation in c language
Dynamic memory allocation in c language
 
Decision statements in c laguage
Decision statements in c laguageDecision statements in c laguage
Decision statements in c laguage
 
Cryptocurrency
Cryptocurrency Cryptocurrency
Cryptocurrency
 

Recently uploaded

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 

Recently uploaded (20)

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 

Arrays in c v1 09102017

  • 2. Definition  An array is a data structure which stores homogeneous(similar)data items.  An array variable is used to store more than one data item of same data type at contiguous memory locations.
  • 3. Example:  C array is beneficial if you have to store similar elements.  Suppose you have to store marks of 50 students, one way to do this is allotting 50 variables.  So it will be typical and hard to manage. For example we can not access the value of these variables with only 1 or 2 lines of code.  Another way to do this is array. By using array, we can access the elements easily. Only few lines of code is required to access the elements of array.
  • 4. Advantage of C Array 1) Code Optimization: Less code to the access the data. 2) Easy to traverse data: By using the for loop, we can retrieve the elements of an array easily. 3) Easy to sort data: To sort the elements of array, we need a few lines of code only. 4) Random Access: We can access any element randomly using the array.
  • 5. Disadvantage of C Array 1) Fixed Size: Whatever size, we define at the time of declaration of array, we can't exceed the limit. So, it doesn't grow the size dynamically like LinkedList
  • 6. Array Terminology Array variable is composed with the following terms:  Size:total number of elements in an array  Type: data type of declared array.  Base:address of the first element of the array.  Index:Location or index value of array element.  Range:Value from lower bound to upper bound.  Word:indicates the space required for an element.
  • 7. Declaration of C Array when array size is given:  We can declare an array in the c language in the following way:  the example to declare array:  Here, int is the data_type, marks is the array_name and 5 is the array_size.
  • 8. Declaration of C Array when array size is not known before compilation: data type array_name []; //size will depend upon the elements entered by user at run time. Example: int a[];
  • 9. Initialization of C Array At the time of declaration:  A simple way to initialize array is by index.  array index starts from 0 and ends with [SIZE - 1].  int a[5]={10,20,30,40,50}
  • 10. Taking input from the user: void main() { int a[5]; for(int i=0;i<5;i++) { to take input printf(“enter the array element”); from the user scanf(“%d”,&a[i]); } for(int i=0;i<5;i++) { to display output printf(“the array is: %d”,a[i]); to the user } }
  • 12. C Array: Declaration with Initialization  We can initialize the c array at the time of declaration.  In such case, there is no requirement to define size. So it can also be written as the following code.
  • 14. Two dimensional Array  The two dimensional array in C language is represented in the form of rows and columns, also known as matrix.  It is also known as array of arrays or list of arrays.  The two dimensional, three dimensional or other dimensional arrays are also known as multidimensional arrays.
  • 15. Declaration of two dimensional Array in C  We can declare an array in the C language in the following way:  A simple example to declare two dimensional array:  Here, 4 is the row number and 3 is the column number.
  • 16. Initialization of 2D Array in C While declaring it: Taking input from the user:
  • 17. Two dimensional array example in C
  • 18. int a[3][3]; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { printf(“enter the arary”); Taking input scanf(“%d”,&a[i][j]); } } for(int i=0;i<3;i++) { for(int j=0;j<3;j++) Giving output {