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
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]
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;
Example of One Dimension Array
Two dimension Array
• The simplest form of multidimensional
array is the two-dimensional array. A two-
dimensional array is, in essence, a list of
one-dimensional arrays. To declare a two-
dimensional integer array of size [x][y], you
would write something as follows
• type arrayName [ x ][ y ];
Multidimensional Array Illustration
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}};
Initializing Two-Dimensional
Arrays
Example of Two dimension Array
Array in-c

More Related Content

PPTX
Array in C
PPTX
Array in c programming
PPTX
Arrays in C++
PPTX
Array in c language
PPTX
2D Array
PPTX
Array and string
PPT
C# Basics
DOC
CS8391 Data Structures 2 mark Questions - Anna University Questions
Array in C
Array in c programming
Arrays in C++
Array in c language
2D Array
Array and string
C# Basics
CS8391 Data Structures 2 mark Questions - Anna University Questions

What's hot (20)

PPTX
PPTX
Data structure array
PPTX
Arrays in java language
PPT
Arrays
PPTX
LIST IN PYTHON
PPTX
Arrays in java
PDF
PDF
Lesson 02 python keywords and identifiers
PDF
Arrays In C
PPT
Constants in C Programming
PPTX
Array in C
PPTX
Variables in python
PPT
Java Arrays
PPT
Arrays in c
PPT
One dimensional 2
PDF
C Programming Storage classes, Recursion
PPT
C++ Arrays
PPTX
Stack and Queue
PPT
Data structure array
Arrays in java language
Arrays
LIST IN PYTHON
Arrays in java
Lesson 02 python keywords and identifiers
Arrays In C
Constants in C Programming
Array in C
Variables in python
Java Arrays
Arrays in c
One dimensional 2
C Programming Storage classes, Recursion
C++ Arrays
Stack and Queue
Ad

Viewers also liked (11)

PPTX
Arrays in C language
PPTX
Arrays In C Language
PPTX
Sequential & binary, linear search
PPT
Strings Functions in C Programming
PDF
C Prog. - Strings (Updated)
PPTX
PPTX
Strings in C
PPT
Computer Programming- Lecture 5
PPTX
Structure in C
PPTX
C Programming Language Tutorial for beginners - JavaTpoint
PPSX
C Programming : Arrays
Arrays in C language
Arrays In C Language
Sequential & binary, linear search
Strings Functions in C Programming
C Prog. - Strings (Updated)
Strings in C
Computer Programming- Lecture 5
Structure in C
C Programming Language Tutorial for beginners - JavaTpoint
C Programming : Arrays
Ad

Similar to Array in-c (20)

PPTX
Array in c language
PPTX
PPTX
Array in c language
PPTX
Array in c language
PPTX
Array in c language
PPTX
Basic array in c programming
PPTX
Array C programming
PDF
Array and its types and it's implemented programming Final.pdf
PPTX
Programming in c Arrays
PDF
PPTX
Array.pptx
PPTX
array-160309152651.pptx
PPTX
Abir ppt3
PPTX
Ch8 Arrays
PPT
uderstanding arrays and how to declare arrays
PPTX
Arrays basics
PPTX
Arrays & Strings
PPT
Array in c
Array in c language
Array in c language
Array in c language
Array in c language
Basic array in c programming
Array C programming
Array and its types and it's implemented programming Final.pdf
Programming in c Arrays
Array.pptx
array-160309152651.pptx
Abir ppt3
Ch8 Arrays
uderstanding arrays and how to declare arrays
Arrays basics
Arrays & Strings
Array in c

More from Samsil Arefin (20)

PPTX
Transmission Control Protocol and User Datagram protocol
PDF
Evolution Phylogenetic
PPTX
Evolution Phylogenetic
PDF
Ego net facebook data analysis
PPTX
Augmented Reality (AR)
PPTX
Client server chat application
PPTX
Strings in programming tutorial.
PDF
Linked list searching deleting inserting
PPTX
Number theory
PDF
Program to sort the n names in an alphabetical order
PDF
Linked list int_data_fdata
PDF
Linked list Output tracing
PDF
PPT
Sorting
PPTX
Fundamentals of-electric-circuit
PPTX
Cyber security
PDF
C programming
PPTX
Data structure lecture 1
PPT
Structure and union
PPT
Structure in programming in c or c++ or c# or java
Transmission Control Protocol and User Datagram protocol
Evolution Phylogenetic
Evolution Phylogenetic
Ego net facebook data analysis
Augmented Reality (AR)
Client server chat application
Strings in programming tutorial.
Linked list searching deleting inserting
Number theory
Program to sort the n names in an alphabetical order
Linked list int_data_fdata
Linked list Output tracing
Sorting
Fundamentals of-electric-circuit
Cyber security
C programming
Data structure lecture 1
Structure and union
Structure in programming in c or c++ or c# or java

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
Complications of Minimal Access Surgery at WLH
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Cell Structure & Organelles in detailed.
PDF
01-Introduction-to-Information-Management.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Microbial diseases, their pathogenesis and prophylaxis
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Week 4 Term 3 Study Techniques revisited.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Basic Mud Logging Guide for educational purpose
Complications of Minimal Access Surgery at WLH
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPH.pptx obstetrics and gynecology in nursing
Pharma ospi slides which help in ospi learning
Cell Structure & Organelles in detailed.
01-Introduction-to-Information-Management.pdf
VCE English Exam - Section C Student Revision Booklet
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Module 4: Burden of Disease Tutorial Slides S2 2025
Final Presentation General Medicine 03-08-2024.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf

Array in-c

  • 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 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. 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. Example of One Dimension Array
  • 9. Two dimension Array • The simplest form of multidimensional array is the two-dimensional array. A two- dimensional array is, in essence, a list of one-dimensional arrays. To declare a two- dimensional integer array of size [x][y], you would write something as follows • type arrayName [ x ][ y ];
  • 10. Multidimensional Array Illustration 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}};
  • 12. Example of Two dimension Array