SlideShare a Scribd company logo
Array in C Language
Index

Introducing Arrays.
Declaration of a Array. Variables,
 Creating Arrays.
The Length of Arrays.
Initializing Arrays.
Multidimensional Arrays.
Introducing Arrays
 Array is a data structure that represents a
  collection of the same types of data.
                int num[10];
Num reference                  num [0]
                               num[1]
                               num[2]
                               num [3]
                                         An Array of 10 Elements
                               num[4]    of type int.
                               num[5]
                               num[6]
                               num[7]
                               num[8]
                               num[9]
Declaring Array Variables


 Data type array name[index];
   Example:
            int list[10];
          char num[15];
          float hat[20];
Creating Arrays
 Data type array-name[size];
  Example:
          int num[10];


 num[0]references the first element in the
 array.
 num[9]references the last element in the
 array.
The Length of Arrays
 Once an array is created, its size is fixed. It
  cannot be changed.
  For Example,
              int arr[10];


   You can not insert any number to arr[11]
  location because it is not initialized.
Initializing Arrays

 Declaring, creating, initializing in one
  step:
    int my Array[5] = {1, 2, 3, 4, 5};
    int studentAge[4];
        studentAge[0] = 14;
        studentAge[1] = 13;
        studentAge[2] = 15;
        studentAge[3] = 16;
Multidimensional Arrays
  int matrix[10] [10];
for (i=0; i<10; i++)
  for (j=0; j<10; j++)
{
     matrix[i] [j] = i * j;
     }

float mat[5] [5];
Multidimensional Array
          Illustration
    0   1    2   3   4       0   1    2   3   4
                                                           0    1        2
0                        0
                                                  0        1    2        3
1                        1
                                                  1        4    5        6
2                        2       7
                                                  2        7    8        9
3                        3
                                                  3        10   11       12
4                        4

int matrix[5] [5];                                    int[][] array ={
                         matrix[2] [1] = 7
                                                      {1, 2, 3},
                                                      {4, 5, 6},
                                                      {7, 8, 9},
                                                      {10, 11, 12}};
Initializing of
           Multidimensional Arrays
To declare, create and initialize a
  multidimensional array.
For example,
     int[][] array = {
       {1, 2, 3},
       {4, 5, 6},
       {7, 8, 9},
       {10, 11, 12}
};

This is equivalent to the following statements:
      array[0][0] = 1;    array[0][1] = 2; array[0][2] = 3;
      array[1][0] = 4;    array[1][1] = 5; array[1][2] = 6;
      array[2][0] = 7;    array[2][1] = 8; array[2][2] = 9;
      array[3][0] = 10;   array[3][1] = 11; array[3][2] = 12;

More Related Content

What's hot

Arrays Basics
Arrays BasicsArrays Basics
Arrays Basics
Nikhil Pandit
 
Arrays in c
Arrays in cArrays in c
Arrays in c
vampugani
 
Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
Awais Alam
 
Array in c programming
Array in c programmingArray in c programming
Array in c programming
Mazharul Islam
 
Pointer in c
Pointer in cPointer in c
Pointer in c
lavanya marichamy
 
C++ Arrays
C++ ArraysC++ Arrays
C++ Arrays
أحمد محمد
 
Array in c++
Array in c++Array in c++
Array in c++
Mahesha Mano
 
concept of Array, 1D & 2D array
concept of Array, 1D & 2D arrayconcept of Array, 1D & 2D array
concept of Array, 1D & 2D array
Sangani Ankur
 
Arrays
ArraysArrays
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
programming9
 
sparse matrix in data structure
sparse matrix in data structuresparse matrix in data structure
sparse matrix in data structure
MAHALAKSHMI P
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
janani thirupathi
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
Rajendran
 
arrays in c
arrays in carrays in c
arrays in c
vidhi mehta
 
Array
ArrayArray
C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : Arrays
Gagan Deep
 
Array Of Pointers
Array Of PointersArray Of Pointers
Array Of Pointers
Sharad Dubey
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in C
Smit Parikh
 
Pointers C programming
Pointers  C programmingPointers  C programming
Pointers C programming
Appili Vamsi Krishna
 

What's hot (20)

Arrays Basics
Arrays BasicsArrays Basics
Arrays Basics
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Arrays In C++
Arrays In C++Arrays In C++
Arrays In C++
 
Array in c programming
Array in c programmingArray in c programming
Array in c programming
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 
C++ Arrays
C++ ArraysC++ Arrays
C++ Arrays
 
Array in c++
Array in c++Array in c++
Array in c++
 
concept of Array, 1D & 2D array
concept of Array, 1D & 2D arrayconcept of Array, 1D & 2D array
concept of Array, 1D & 2D array
 
Arrays
ArraysArrays
Arrays
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
sparse matrix in data structure
sparse matrix in data structuresparse matrix in data structure
sparse matrix in data structure
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
arrays in c
arrays in carrays in c
arrays in c
 
Array
ArrayArray
Array
 
C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : Arrays
 
Array Of Pointers
Array Of PointersArray Of Pointers
Array Of Pointers
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in C
 
Pointers C programming
Pointers  C programmingPointers  C programming
Pointers C programming
 

Viewers also liked

Array in c
Array in cArray in c
Array in c
Ravi Gelani
 
Structure in C
Structure in CStructure in C
Structure in C
Fazle Rabbi Ador
 
Structure c
Structure cStructure c
Structure c
thirumalaikumar3
 
Strings in C
Strings in CStrings in C
Strings in C
Kamal Acharya
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
Shubham Sharma
 
String c
String cString c
String in c
String in cString in c
String in c
Suneel Dogra
 

Viewers also liked (10)

Array in c
Array in cArray in c
Array in c
 
Structure in C
Structure in CStructure in C
Structure in C
 
Structure c
Structure cStructure c
Structure c
 
Strings in C
Strings in CStrings in C
Strings in C
 
String functions in C
String functions in CString functions in C
String functions in C
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Structure in c
Structure in cStructure in c
Structure in c
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
String c
String cString c
String c
 
String in c
String in cString in c
String in c
 

Similar to Array in c language

Arrays in CPP
Arrays in CPPArrays in CPP
Arrays in CPP
Shakila Mahjabin
 
JavaYDL7
JavaYDL7JavaYDL7
JavaYDL7
Terry Yoast
 
Multi dimensional arrays
Multi dimensional arraysMulti dimensional arrays
Multi dimensional arraysAseelhalees
 
pptt.pptx
pptt.pptxpptt.pptx
Lecture17 arrays.ppt
Lecture17 arrays.pptLecture17 arrays.ppt
Lecture17 arrays.ppt
eShikshak
 
array
array array
รายงานคอม
รายงานคอมรายงานคอม
รายงานคอมAreeya Onnom
 
Array
ArrayArray
Array
PRN USM
 
Array
ArrayArray
Array in c language
Array in c languageArray in c language
Array in c language
umesh patil
 
Array in c language
Array in c languageArray in c language
Array in c language
sanjay joshi
 
รายงานคอม
รายงานคอมรายงานคอม
รายงานคอมAreeya Onnom
 
L10 array
L10 arrayL10 array
L10 array
teach4uin
 
Unit4 Slides
Unit4 SlidesUnit4 Slides
Unit4 Slides
Rakesh Roshan
 
Lecture 6 - Arrays
Lecture 6 - ArraysLecture 6 - Arrays
Lecture 6 - Arrays
Syed Afaq Shah MACS CP
 
Arrays
ArraysArrays

Similar to Array in c language (20)

Arrays in CPP
Arrays in CPPArrays in CPP
Arrays in CPP
 
07slide
07slide07slide
07slide
 
JavaYDL7
JavaYDL7JavaYDL7
JavaYDL7
 
Multi dimensional arrays
Multi dimensional arraysMulti dimensional arrays
Multi dimensional arrays
 
pptt.pptx
pptt.pptxpptt.pptx
pptt.pptx
 
Lecture17 arrays.ppt
Lecture17 arrays.pptLecture17 arrays.ppt
Lecture17 arrays.ppt
 
Array
ArrayArray
Array
 
Arrays
ArraysArrays
Arrays
 
array
array array
array
 
รายงานคอม
รายงานคอมรายงานคอม
รายงานคอม
 
Array
ArrayArray
Array
 
7. arrays
7. arrays7. arrays
7. arrays
 
Array
ArrayArray
Array
 
Array in c language
Array in c languageArray in c language
Array in c language
 
Array in c language
Array in c languageArray in c language
Array in c language
 
รายงานคอม
รายงานคอมรายงานคอม
รายงานคอม
 
L10 array
L10 arrayL10 array
L10 array
 
Unit4 Slides
Unit4 SlidesUnit4 Slides
Unit4 Slides
 
Lecture 6 - Arrays
Lecture 6 - ArraysLecture 6 - Arrays
Lecture 6 - Arrays
 
Arrays
ArraysArrays
Arrays
 

More from home

3D Printer
3D Printer3D Printer
3D Printerhome
 
Software project management by Walker Royce
Software project management by Walker RoyceSoftware project management by Walker Royce
Software project management by Walker Roycehome
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer home
 
Matrimonial web site Documentation
Matrimonial web site DocumentationMatrimonial web site Documentation
Matrimonial web site Documentationhome
 
Linux
LinuxLinux
Linux
home
 
Internet Technology
Internet TechnologyInternet Technology
Internet Technologyhome
 
Internet Technology
Internet TechnologyInternet Technology
Internet Technologyhome
 
Internet Technology
Internet TechnologyInternet Technology
Internet Technologyhome
 
Software techniques
Software techniquesSoftware techniques
Software techniqueshome
 

More from home (9)

3D Printer
3D Printer3D Printer
3D Printer
 
Software project management by Walker Royce
Software project management by Walker RoyceSoftware project management by Walker Royce
Software project management by Walker Royce
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer
 
Matrimonial web site Documentation
Matrimonial web site DocumentationMatrimonial web site Documentation
Matrimonial web site Documentation
 
Linux
LinuxLinux
Linux
 
Internet Technology
Internet TechnologyInternet Technology
Internet Technology
 
Internet Technology
Internet TechnologyInternet Technology
Internet Technology
 
Internet Technology
Internet TechnologyInternet Technology
Internet Technology
 
Software techniques
Software techniquesSoftware techniques
Software techniques
 

Recently uploaded

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Array in c language

  • 1. Array in C Language
  • 2. Index Introducing Arrays. Declaration of a Array. Variables, Creating Arrays. The Length of Arrays. Initializing Arrays. Multidimensional Arrays.
  • 3. Introducing Arrays  Array is a data structure that represents a collection of the same types of data. int num[10]; Num reference num [0] num[1] num[2] num [3] An Array of 10 Elements num[4] of type int. num[5] num[6] num[7] num[8] num[9]
  • 4. Declaring Array Variables  Data type array name[index]; Example: int list[10]; char num[15]; float hat[20];
  • 5. Creating Arrays  Data type array-name[size]; Example: int num[10]; num[0]references the first element in the array. num[9]references the last element in the array.
  • 6. The Length of Arrays  Once an array is created, its size is fixed. It cannot be changed. For Example, int arr[10]; You can not insert any number to arr[11] location because it is not initialized.
  • 7. Initializing Arrays  Declaring, creating, initializing in one step: int my Array[5] = {1, 2, 3, 4, 5}; int studentAge[4]; studentAge[0] = 14; studentAge[1] = 13; studentAge[2] = 15; studentAge[3] = 16;
  • 8. Multidimensional Arrays int matrix[10] [10]; for (i=0; i<10; i++) for (j=0; j<10; j++) { matrix[i] [j] = i * j; } float mat[5] [5];
  • 9. Multidimensional Array Illustration 0 1 2 3 4 0 1 2 3 4 0 1 2 0 0 0 1 2 3 1 1 1 4 5 6 2 2 7 2 7 8 9 3 3 3 10 11 12 4 4 int matrix[5] [5]; int[][] array ={ matrix[2] [1] = 7 {1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}};
  • 10. Initializing of Multidimensional Arrays To declare, create and initialize a multidimensional array. For example, int[][] array = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12} }; This is equivalent to the following statements: array[0][0] = 1; array[0][1] = 2; array[0][2] = 3; array[1][0] = 4; array[1][1] = 5; array[1][2] = 6; array[2][0] = 7; array[2][1] = 8; array[2][2] = 9; array[3][0] = 10; array[3][1] = 11; array[3][2] = 12;