SlideShare a Scribd company logo
1 of 19
Do You Know
What Is Array In C
Programming ??
PRESENTED BY :
Pranto Sharma --------------------- 161-15-7539
Sabbir Rahman----------------------161-15-7123
Kaniz Assami Tokey---------------161-15-7608
Md anando Islam Riyed----------152-15-5778
INDEX:
Introducing Arrays.
Declaration of a Array. Variables, Creating Arrays.
The Length of Arrays.
Initializing Arrays.
Defining the size of the array
Different types of arrays
Multidimensional Arrays
INTRODUCING ARRAYS :
An array is a collection of variables of the same type that
are referred to through a common name.
int num[10];
Num reference num [0]
num[1]
num[2]
num [3]
num[4]
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;
DEFINING THE SIZE OF THE ARRAY :
• It is a good programming practice to define the size of an
array as symbolic constant
• Example
#define size 10
int a[size];
DIFFERENT TYPES OF ARRAYS :
1- dimensional array
2-dimensional array
Multi-dimensional array
ONE-DIMENSIONAL ARRAYS :
• One dimensional array have only one subscript under a
common name.
• syntax
• Data_type array_name[array_size];
• Example
• int age[5]={2,4,34,3,4};
EXAMPLE PROGRAM :
#include<stdio.h>
int main()
{ int a[4];
int i;
for ( i = 0; i < 4; i++ )
{
Scanf(“%d”,&a[i]);
}
for ( i = 0; i < 4; i++ )
printf("a[%d] = %dn", i , a[i]);
return 0;
}
TWO-DIMENSIONAL ARRAYS :
Two-dimensional array are those type of
array, which has finite number of rows and
finite number of columns. 2D arrays are
generally known as matrix. We will discuss two
Dimensional array in detail but before this
have a look at the below piece of code .
Data_type Array_name [row size][column
size];
Rows
Columns
int color[r] [c];
[0]
[1]
[2]
[0] [1] [2]
EXAMPLE PROGRAM :
#include<stdio.h>
int main()
{
int disp[3][5];
int i, j;
for(i=0; i<=2; i++)
{
for(j=0;j<=4;j++)
{
printf("Enter value for disp[%d][%d]:", i, j);
scanf("%d", &disp[i][j]);
}
}
return 0;
}
MULTI-DIMENSIONAL ARRAYS :
An array have multiple subscript under a
common name.
Syntax
type name[size1][size2]...[sizeN];
Example
float a[2][6][7][4]….[n];
EXAMPLE PROGRAM :
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];
INITIALIZING OF MULTIDIMENSIONAL ARRAYS :
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;
Basic array in c programming

More Related Content

What's hot

concept of Array, 1D & 2D array
concept of Array, 1D & 2D arrayconcept of Array, 1D & 2D array
concept of Array, 1D & 2D arraySangani Ankur
 
Strings Functions in C Programming
Strings Functions in C ProgrammingStrings Functions in C Programming
Strings Functions in C ProgrammingDevoAjit Gupta
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in CMuthuganesh S
 
Array in c language
Array in c languageArray in c language
Array in c languagehome
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control StructureSokngim Sa
 
Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)Fatima Kate Tanay
 
Arrays in python
Arrays in pythonArrays in python
Arrays in pythonmoazamali28
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++HalaiHansaika
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm KristinaBorooah
 

What's hot (20)

Arrays
ArraysArrays
Arrays
 
concept of Array, 1D & 2D array
concept of Array, 1D & 2D arrayconcept of Array, 1D & 2D array
concept of Array, 1D & 2D array
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
C++ Arrays
C++ ArraysC++ Arrays
C++ Arrays
 
Strings Functions in C Programming
Strings Functions in C ProgrammingStrings Functions in C Programming
Strings Functions in C Programming
 
C Token’s
C Token’sC Token’s
C Token’s
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in C
 
Array in c language
Array in c languageArray in c language
Array in c language
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
Structure in C
Structure in CStructure in C
Structure in C
 
Function C programming
Function C programmingFunction C programming
Function C programming
 
Data structure using c++
Data structure using c++Data structure using c++
Data structure using c++
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)Passing an Array to a Function (ICT Programming)
Passing an Array to a Function (ICT Programming)
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
C++ presentation
C++ presentationC++ presentation
C++ presentation
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 

Viewers also liked

Viewers also liked (11)

Arrays in C
Arrays in CArrays in C
Arrays in C
 
Pointer in C++
Pointer in C++Pointer in C++
Pointer in C++
 
Structures
StructuresStructures
Structures
 
Pointer in c++ part2
Pointer in c++ part2Pointer in c++ part2
Pointer in c++ part2
 
Amazon Web Services
Amazon Web ServicesAmazon Web Services
Amazon Web Services
 
One dimensional arrays
One dimensional arraysOne dimensional arrays
One dimensional arrays
 
Pointer in c++ part3
Pointer in c++ part3Pointer in c++ part3
Pointer in c++ part3
 
jal hi jivan hai pre prentation
jal hi jivan hai pre prentationjal hi jivan hai pre prentation
jal hi jivan hai pre prentation
 
Array in C
Array in CArray in C
Array in C
 
Arrays
ArraysArrays
Arrays
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 

Similar to Basic array in c programming (20)

C++ lecture 04
C++ lecture 04C++ lecture 04
C++ lecture 04
 
Arrays basics
Arrays basicsArrays basics
Arrays basics
 
strings.ppt
strings.pptstrings.ppt
strings.ppt
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Array C programming
Array C programmingArray C programming
Array C programming
 
Arrays In General
Arrays In GeneralArrays In General
Arrays In General
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
Array.pptx
Array.pptxArray.pptx
Array.pptx
 
Array.pptx
Array.pptxArray.pptx
Array.pptx
 
C (PPS)Programming for problem solving.pptx
C (PPS)Programming for problem solving.pptxC (PPS)Programming for problem solving.pptx
C (PPS)Programming for problem solving.pptx
 
Abir ppt3
Abir ppt3Abir ppt3
Abir ppt3
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
Arrays
ArraysArrays
Arrays
 
Array
ArrayArray
Array
 
Array-part1
Array-part1Array-part1
Array-part1
 
Arrays & Strings.pptx
Arrays & Strings.pptxArrays & Strings.pptx
Arrays & Strings.pptx
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
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
 
Array in c++
Array in c++Array in c++
Array in c++
 
Java part 2
Java part  2Java part  2
Java part 2
 

More from Sajid Hasan

Digital differential analyzer
Digital differential analyzerDigital differential analyzer
Digital differential analyzerSajid Hasan
 
Rgb and Cmy color model
Rgb and Cmy color modelRgb and Cmy color model
Rgb and Cmy color modelSajid Hasan
 
Web Security Attacks
Web Security AttacksWeb Security Attacks
Web Security AttacksSajid Hasan
 
Lcs & fractional knapsack
Lcs & fractional knapsackLcs & fractional knapsack
Lcs & fractional knapsackSajid Hasan
 
Bar chart, pie chart, histogram
Bar chart, pie chart, histogramBar chart, pie chart, histogram
Bar chart, pie chart, histogramSajid Hasan
 
Rangpur as a division in Bangladesh
Rangpur as a division in BangladeshRangpur as a division in Bangladesh
Rangpur as a division in BangladeshSajid Hasan
 

More from Sajid Hasan (12)

Digital differential analyzer
Digital differential analyzerDigital differential analyzer
Digital differential analyzer
 
Rgb and Cmy color model
Rgb and Cmy color modelRgb and Cmy color model
Rgb and Cmy color model
 
Web Security Attacks
Web Security AttacksWeb Security Attacks
Web Security Attacks
 
Line coding
Line codingLine coding
Line coding
 
Plasmid
PlasmidPlasmid
Plasmid
 
Lcs & fractional knapsack
Lcs & fractional knapsackLcs & fractional knapsack
Lcs & fractional knapsack
 
Bar chart, pie chart, histogram
Bar chart, pie chart, histogramBar chart, pie chart, histogram
Bar chart, pie chart, histogram
 
Semiconductor
SemiconductorSemiconductor
Semiconductor
 
Rangpur as a division in Bangladesh
Rangpur as a division in BangladeshRangpur as a division in Bangladesh
Rangpur as a division in Bangladesh
 
Cyber security
Cyber securityCyber security
Cyber security
 
Cyber security
Cyber securityCyber security
Cyber security
 
Cyber security
Cyber securityCyber security
Cyber security
 

Recently uploaded

Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
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
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
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
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
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
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
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
 

Recently uploaded (20)

TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
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
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
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
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
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
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
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 🔝✔️✔️
 

Basic array in c programming

  • 1. Do You Know What Is Array In C Programming ??
  • 2. PRESENTED BY : Pranto Sharma --------------------- 161-15-7539 Sabbir Rahman----------------------161-15-7123 Kaniz Assami Tokey---------------161-15-7608 Md anando Islam Riyed----------152-15-5778
  • 3. INDEX: Introducing Arrays. Declaration of a Array. Variables, Creating Arrays. The Length of Arrays. Initializing Arrays. Defining the size of the array Different types of arrays Multidimensional Arrays
  • 4. INTRODUCING ARRAYS : An array is a collection of variables of the same type that are referred to through a common name. int num[10]; Num reference num [0] num[1] num[2] num [3] num[4] num[5] num[6] num[7] num[8] num[9]
  • 5. DECLARING ARRAY VARIABLES : Data type array name[index]; Example: int list[10]; char num[15]; float hat[20];
  • 6. 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.
  • 7. 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.
  • 8. 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;
  • 9. DEFINING THE SIZE OF THE ARRAY : • It is a good programming practice to define the size of an array as symbolic constant • Example #define size 10 int a[size];
  • 10. DIFFERENT TYPES OF ARRAYS : 1- dimensional array 2-dimensional array Multi-dimensional array
  • 11. ONE-DIMENSIONAL ARRAYS : • One dimensional array have only one subscript under a common name. • syntax • Data_type array_name[array_size]; • Example • int age[5]={2,4,34,3,4};
  • 12. EXAMPLE PROGRAM : #include<stdio.h> int main() { int a[4]; int i; for ( i = 0; i < 4; i++ ) { Scanf(“%d”,&a[i]); } for ( i = 0; i < 4; i++ ) printf("a[%d] = %dn", i , a[i]); return 0; }
  • 13. TWO-DIMENSIONAL ARRAYS : Two-dimensional array are those type of array, which has finite number of rows and finite number of columns. 2D arrays are generally known as matrix. We will discuss two Dimensional array in detail but before this have a look at the below piece of code . Data_type Array_name [row size][column size];
  • 15. EXAMPLE PROGRAM : #include<stdio.h> int main() { int disp[3][5]; int i, j; for(i=0; i<=2; i++) { for(j=0;j<=4;j++) { printf("Enter value for disp[%d][%d]:", i, j); scanf("%d", &disp[i][j]); } } return 0; }
  • 16. MULTI-DIMENSIONAL ARRAYS : An array have multiple subscript under a common name. Syntax type name[size1][size2]...[sizeN]; Example float a[2][6][7][4]….[n];
  • 17. EXAMPLE PROGRAM : 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];
  • 18. INITIALIZING OF MULTIDIMENSIONAL ARRAYS : 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;