SlideShare a Scribd company logo
10
Most read
*Array in C Language
*Introducing Arrays.
Declaration of a Array. Variables, Creating
Arrays.
The Length of Arrays.
Initializing Arrays.
Multidimensional Arrays.
*
Array is a data structure that represents a
collection of the same types of data.
int num[10];
Num reference
An Array of 10 Elements
of type int.
num [0]
num[1]
num[2]
num [3]
num[4]
num[5]
num[6]
num[7]
num[8]
num[9]
*
Data type array name[index];
Example:
int list[10];
char num[15];
float hat[20];
*
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.
*
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.
*
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;
*
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];
*
0 1 2 3 4
0
1
2
3
4
0 1 2 3 4
0
1
2 7
3
4
int matrix[5]
[5];
matrix[2] [1] =
7
0 1 2
0 1 2 3
1 4 5 6
2 7 8 9
3 10 11 12
int[][] array
={
{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{10, 11, 12}};
*
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 (20)

PPTX
Array in C
Kamal Acharya
 
PPTX
Array in c programming
Mazharul Islam
 
PPTX
Array in c programming
2569294Mohan
 
PDF
SPL 10 | One Dimensional Array in C
Mohammad Imam Hossain
 
PDF
Lecture17 arrays.ppt
eShikshak
 
PPTX
Introduction to Array ppt
sandhya yadav
 
PPTX
Array in c
AnIsh Kumar
 
PPTX
Array in c
AnIsh Kumar
 
PPTX
Basic array in c programming
Sajid Hasan
 
PPSX
C Programming : Arrays
Gagan Deep
 
PPTX
C++ programming (Array)
طارق بالحارث
 
PPT
Arrays Basics
Nikhil Pandit
 
PPTX
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 
PPTX
Arrays in c language
tanmaymodi4
 
PPTX
Array in (C) programing
mJafarww
 
PPTX
Pf presntation
Roshan Roshan Ansari
 
PPT
Array in c
Ravi Gelani
 
PPTX
concept of Array, 1D & 2D array
Sangani Ankur
 
PPT
Array
Hajar
 
PPTX
Array in c++
Mahesha Mano
 
Array in C
Kamal Acharya
 
Array in c programming
Mazharul Islam
 
Array in c programming
2569294Mohan
 
SPL 10 | One Dimensional Array in C
Mohammad Imam Hossain
 
Lecture17 arrays.ppt
eShikshak
 
Introduction to Array ppt
sandhya yadav
 
Array in c
AnIsh Kumar
 
Array in c
AnIsh Kumar
 
Basic array in c programming
Sajid Hasan
 
C Programming : Arrays
Gagan Deep
 
C++ programming (Array)
طارق بالحارث
 
Arrays Basics
Nikhil Pandit
 
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 
Arrays in c language
tanmaymodi4
 
Array in (C) programing
mJafarww
 
Pf presntation
Roshan Roshan Ansari
 
Array in c
Ravi Gelani
 
concept of Array, 1D & 2D array
Sangani Ankur
 
Array
Hajar
 
Array in c++
Mahesha Mano
 

Viewers also liked (15)

PPTX
Cloud computing
umesh patil
 
PPT
Node js
umesh patil
 
PPTX
Ccna security
umesh patil
 
PPT
Oops and c fundamentals
umesh patil
 
PPT
Java script
umesh patil
 
PPTX
Solve five problems related to computer
umesh patil
 
PPT
Web api's
umesh patil
 
PPTX
css and wordpress
umesh patil
 
PPT
Cloud computing
umesh patil
 
PPTX
Introduction to asp .net
umesh patil
 
PPTX
html & css
umesh patil
 
PPT
C# programming
umesh patil
 
PPTX
Html and css presentation
umesh patil
 
PPTX
Html basic tags
umesh patil
 
PPT
Code igniter overview
umesh patil
 
Cloud computing
umesh patil
 
Node js
umesh patil
 
Ccna security
umesh patil
 
Oops and c fundamentals
umesh patil
 
Java script
umesh patil
 
Solve five problems related to computer
umesh patil
 
Web api's
umesh patil
 
css and wordpress
umesh patil
 
Cloud computing
umesh patil
 
Introduction to asp .net
umesh patil
 
html & css
umesh patil
 
C# programming
umesh patil
 
Html and css presentation
umesh patil
 
Html basic tags
umesh patil
 
Code igniter overview
umesh patil
 
Ad

Similar to Array in c language (20)

PPTX
pptt.pptx
SubhamMukherjee42
 
PDF
Array and its types and it's implemented programming Final.pdf
ajajkhan16
 
PPTX
Array.pptx
fixocin377
 
PDF
Arrays
Steven Wallach
 
PPTX
Programming in c Arrays
janani thirupathi
 
PPT
Arrays
swathi reddy
 
PPTX
Chapter 13.pptx
AnisZahirahAzman
 
PDF
Array
hjasjhd
 
PPTX
Arrays in c
Jeeva Nanthini
 
PPTX
Abir ppt3
abir96
 
PPTX
Arrays basics
sudhirvegad
 
PPTX
BHARGAVIARRAY.PPT.pptx
Sasideepa
 
PPTX
array-160309152651.pptx
karunapatel13
 
PPTX
Arrays in c v1 09102017
Tanmay Modi
 
PDF
Arraysincv109102017 180831194256
ABHAY9616302301
 
PPTX
Introduction to Array & Structure & Basic Algorithms.pptx
MrNikhilMohanShinde
 
PDF
Array in C full basic explanation
TeresaJencyBala
 
DOC
Arrays and Strings
Dr.Subha Krishna
 
Array and its types and it's implemented programming Final.pdf
ajajkhan16
 
Array.pptx
fixocin377
 
Programming in c Arrays
janani thirupathi
 
Arrays
swathi reddy
 
Chapter 13.pptx
AnisZahirahAzman
 
Array
hjasjhd
 
Arrays in c
Jeeva Nanthini
 
Abir ppt3
abir96
 
Arrays basics
sudhirvegad
 
BHARGAVIARRAY.PPT.pptx
Sasideepa
 
array-160309152651.pptx
karunapatel13
 
Arrays in c v1 09102017
Tanmay Modi
 
Arraysincv109102017 180831194256
ABHAY9616302301
 
Introduction to Array & Structure & Basic Algorithms.pptx
MrNikhilMohanShinde
 
Array in C full basic explanation
TeresaJencyBala
 
Arrays and Strings
Dr.Subha Krishna
 
Ad

More from umesh patil (19)

PPTX
Ccna security
umesh patil
 
PPTX
Jquery Preparation
umesh patil
 
PPTX
Cloud computing
umesh patil
 
PPT
Static and dynamic polymorphism
umesh patil
 
PPTX
Introduction to asp .net
umesh patil
 
PPTX
C language
umesh patil
 
PPTX
Html Presentation
umesh patil
 
PPTX
Cloud computing
umesh patil
 
PPTX
Function in c program
umesh patil
 
PPTX
css and wordpress
umesh patil
 
PPTX
Php vs asp
umesh patil
 
PPS
C language
umesh patil
 
PPT
Visual basic
umesh patil
 
PPT
Database management system presentation
umesh patil
 
PPTX
Asp .net Jquery
umesh patil
 
PPT
Architecture of net framework
umesh patil
 
PPT
Data mining and data warehousing
umesh patil
 
PPT
Java script
umesh patil
 
PPTX
Css
umesh patil
 
Ccna security
umesh patil
 
Jquery Preparation
umesh patil
 
Cloud computing
umesh patil
 
Static and dynamic polymorphism
umesh patil
 
Introduction to asp .net
umesh patil
 
C language
umesh patil
 
Html Presentation
umesh patil
 
Cloud computing
umesh patil
 
Function in c program
umesh patil
 
css and wordpress
umesh patil
 
Php vs asp
umesh patil
 
C language
umesh patil
 
Visual basic
umesh patil
 
Database management system presentation
umesh patil
 
Asp .net Jquery
umesh patil
 
Architecture of net framework
umesh patil
 
Data mining and data warehousing
umesh patil
 
Java script
umesh patil
 

Recently uploaded (20)

PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPTX
QUARTER 1 WEEK 2 PLOT, POV AND CONFLICTS
KynaParas
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Horarios de distribución de agua en julio
pegazohn1978
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
QUARTER 1 WEEK 2 PLOT, POV AND CONFLICTS
KynaParas
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 

Array in c language

  • 1. *Array in C Language
  • 2. *Introducing Arrays. Declaration of a Array. Variables, Creating Arrays. The Length of Arrays. Initializing Arrays. Multidimensional Arrays.
  • 3. * Array is a data structure that represents a collection of the same types of data. int num[10]; Num reference An Array of 10 Elements of type int. num [0] num[1] num[2] num [3] num[4] num[5] num[6] num[7] num[8] num[9]
  • 4. * Data type array name[index]; Example: int list[10]; char num[15]; float hat[20];
  • 5. * 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. * 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. * 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. * 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. * 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 7 3 4 int matrix[5] [5]; matrix[2] [1] = 7 0 1 2 0 1 2 3 1 4 5 6 2 7 8 9 3 10 11 12 int[][] array ={ {1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}};
  • 10. * 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;