SlideShare a Scribd company logo
ARRAYS IN C
PRESENTED BY:
Narra bhargavi
22AJ1A0562
CSE-A
INTRODUCTION
• We know the fundamental data types, namely
char, int, float, double and it’s variations.
• Although these types are very useful, the
variable of these types can store only one value
at a given time.
• Therefore, these data types can be used only to
handle limited amounts of data.
• In many applications we need handle large
volume of data for processing.
• To process such large amounts of data we need
a powerful data type.
DEFINITION OF ARRAY
• An array is a fixed–size sequenced collection of
elements of same data type
• In simplest form, an array can be used to
represent a list of numbers, a list of names.
• An array is a collection of similar data items,
that are stored under a common name.
• A value in an array is identified by index or
subscript enclosed in square bracket with array
name.
FEATURES OF ARRAYS
• An array is a derived data type. It is used to
represent a collection of elements of the same
data type.
• The elements can be accessed with base
address (index) and the subscript defined for
the position of the element.
• The elements in an array are stored in
contiguous memory location.
• It is easier to refer the array elements by simply
incrementing the value of the subscript.
TYPES OF ARRAYS
1. One dimensional array
2. Two dimensional array
3. Multidimensional array
ONE DIMENSIONAL ARRAY
The collection of data items can be
stored under a variable name using only
one subscript
ARRAY DECLARATION
The general form of array declaration is:
data_type array_variable-name[size];
• Data_type – specifies the type of element that
will be contained in the array , such as int, char
• size –indicates the maximum number of
elements that can be stored inside the array.
EXAMPLE
• For example we want to represent a set of five numbers,
say (10,20,30,40,50) by an array variable number, then we
may declare the variable number as follows
int number[5];
• and the computer reserves five storage locations as shown
below:
Number[0]
Number[1]
Number[2]
Number[3]
Number[4]
ARRAY INTIALIZATION
Syntax:
data_type array_variable-name[SIZE]={LIST OF VALUE}
EXAMPLE :
int number[5]={10,20,30,40,50};
Number[0]
Number[1]
Number[2]
Number[3]
Number[4]
fv
10
20
30
40
50
MORE EXAMPLES FOR ARRAY INITIALIZATION
int counter[ ]= {10,20,30,40,50};
char name[ ]= { ’J’ , ’H’ , ’O’ , ’N’ , ’0” };
alternatively,
char name[ ]= “john”; //array with string
int number[5]={10,20};
number[0]=10,number[1]=20,
number[2]=0,number[3]=0,number[4]=0
•we can also initialize an array with scanf() function.
for example,
int x[5];
printf(“enter the values:”);
scanf(“%d%d%d”,&x[0],&x[1],&x[2]);
EXAMPLE PROGRAM
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],sum=0,i;
printf(“Enter 5 numbers”);
for(i=0;i<5;i++)
{
scanf(“%dn”,&a[i]);
sum=sum+a[i];
}
printf(“the sum of given numbers is : %dn”, sum);
}
TWO DIMENSIONAL ARRAY
SYNTAX:
data_type array_name [row-size][column-size];
INITIAZING TWO DIMENSIONAL ARRAY:
Like one dimensional arrays, two dimensional arrays can be
initialized by their declaration
int table[2][3] = {0,0,0,1,1,1};
will assigns the values as follows,
table[0][1]=0, table[0][1]=0, table[0][2]=0,
table[1][0]=1, table[1][1]=1, table[1][2]=1
the above statement can be written as
int table[2][3]={{0,0,0},{1,1,1}};
also
int table[2][3] = {
{0,0,0},
{1,1,1}
};
Example program
#include <stdio.h>
main()
{
int m, n, i, j, first[10][10], second[10][10], sum[10][10];
printf("Enter the number of rows and columns of matrix ");
scanf("%d%d", &m, &n);
printf("Enter the elements of first matrixn");
for ( i = 0 ; i< m ; i++ )
for ( j = 0 ; j < n ; j++ )
scanf("%d", &first[i][j]);
printf("Enter the elements of second matrixn");
for ( i = 0 ; i < m ; i++ )
for ( j = 0 ; j < n ; j++ )
scanf("%d", &second[i][j]);
for ( i= 0 ; i < m ; i++ )
for ( j = 0 ; j< n ; j++ )
sum[i][j] = first[i][j] + second[i][j];
printf("Sum of entered matrices:-n");
for ( i= 0 ; i< m ; i++ )
{
for ( j = 0 ; j < n ; j++ )
printf("%dt", sum[i][j]);
printf("n");
}
return 0;
}
MULTI-DIMENSIONAL ARRAY
C allows arrays of more-dimensions called multi-
dimensional array.
The general form of a multi-dimensional array is:
Type array-name[s1][s2][s3]…..[sn]
Where ‘s’ is the size of the dimension
int survey[3][5][2];
float table[5][4][5][3];

More Related Content

Similar to BHARGAVIARRAY.PPT.pptx

Presentation on array
Presentation on array Presentation on array
Presentation on array
topu93
 
Arrays
ArraysArrays
Arrays in c
Arrays in cArrays in c
Arrays in c
CHANDAN KUMAR
 
Introduction to Arrays in C
Introduction to Arrays in CIntroduction to Arrays in C
Introduction to Arrays in C
Thesis Scientist Private Limited
 
lec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptxlec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptx
shiks1234
 
Arrays
ArraysArrays
Arrays
swathi reddy
 
Chapter 4 (Part I) - Array and Strings.pdf
Chapter 4 (Part I) - Array and Strings.pdfChapter 4 (Part I) - Array and Strings.pdf
Chapter 4 (Part I) - Array and Strings.pdf
KirubelWondwoson1
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
Maliha Mehr
 
arrays.docx
arrays.docxarrays.docx
Arrays in C++ in Tamil - TNSCERT SYLLABUS PPT
Arrays in C++ in Tamil - TNSCERT SYLLABUS PPT Arrays in C++ in Tamil - TNSCERT SYLLABUS PPT
Arrays in C++ in Tamil - TNSCERT SYLLABUS PPT
LATHA LAKSHMI
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
MamataAnilgod
 
Lecture 15 - Array
Lecture 15 - ArrayLecture 15 - Array
Lecture 15 - Array
Md. Imran Hossain Showrov
 
Array in c
Array in cArray in c
Array in c
Harsh Bhanushali
 
data structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptxdata structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptx
coc7987515756
 
Arrays In C Language
Arrays In C LanguageArrays In C Language
Arrays In C Language
Surbhi Yadav
 
Arrays
ArraysArrays
Programming in c arrays
Programming in c   arraysProgramming in c   arrays
Programming in c arrays
Uma mohan
 
Arrays
ArraysArrays
Arrays
ArraysArrays
Arrays
ViniVini48
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
sandhya yadav
 

Similar to BHARGAVIARRAY.PPT.pptx (20)

Presentation on array
Presentation on array Presentation on array
Presentation on array
 
Arrays
ArraysArrays
Arrays
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Introduction to Arrays in C
Introduction to Arrays in CIntroduction to Arrays in C
Introduction to Arrays in C
 
lec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptxlec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptx
 
Arrays
ArraysArrays
Arrays
 
Chapter 4 (Part I) - Array and Strings.pdf
Chapter 4 (Part I) - Array and Strings.pdfChapter 4 (Part I) - Array and Strings.pdf
Chapter 4 (Part I) - Array and Strings.pdf
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
arrays.docx
arrays.docxarrays.docx
arrays.docx
 
Arrays in C++ in Tamil - TNSCERT SYLLABUS PPT
Arrays in C++ in Tamil - TNSCERT SYLLABUS PPT Arrays in C++ in Tamil - TNSCERT SYLLABUS PPT
Arrays in C++ in Tamil - TNSCERT SYLLABUS PPT
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
Lecture 15 - Array
Lecture 15 - ArrayLecture 15 - Array
Lecture 15 - Array
 
Array in c
Array in cArray in c
Array in c
 
data structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptxdata structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptx
 
Arrays In C Language
Arrays In C LanguageArrays In C Language
Arrays In C Language
 
Arrays
ArraysArrays
Arrays
 
Programming in c arrays
Programming in c   arraysProgramming in c   arrays
Programming in c arrays
 
Arrays
ArraysArrays
Arrays
 
Arrays
ArraysArrays
Arrays
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 

Recently uploaded

basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
This is my Environmental physics presentation
This is my Environmental physics presentationThis is my Environmental physics presentation
This is my Environmental physics presentation
ZainabHashmi17
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
skuxot
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 

Recently uploaded (20)

basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
This is my Environmental physics presentation
This is my Environmental physics presentationThis is my Environmental physics presentation
This is my Environmental physics presentation
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 

BHARGAVIARRAY.PPT.pptx

  • 1. ARRAYS IN C PRESENTED BY: Narra bhargavi 22AJ1A0562 CSE-A
  • 2. INTRODUCTION • We know the fundamental data types, namely char, int, float, double and it’s variations. • Although these types are very useful, the variable of these types can store only one value at a given time. • Therefore, these data types can be used only to handle limited amounts of data. • In many applications we need handle large volume of data for processing. • To process such large amounts of data we need a powerful data type.
  • 3. DEFINITION OF ARRAY • An array is a fixed–size sequenced collection of elements of same data type • In simplest form, an array can be used to represent a list of numbers, a list of names. • An array is a collection of similar data items, that are stored under a common name. • A value in an array is identified by index or subscript enclosed in square bracket with array name.
  • 4. FEATURES OF ARRAYS • An array is a derived data type. It is used to represent a collection of elements of the same data type. • The elements can be accessed with base address (index) and the subscript defined for the position of the element. • The elements in an array are stored in contiguous memory location. • It is easier to refer the array elements by simply incrementing the value of the subscript.
  • 5. TYPES OF ARRAYS 1. One dimensional array 2. Two dimensional array 3. Multidimensional array ONE DIMENSIONAL ARRAY The collection of data items can be stored under a variable name using only one subscript
  • 6. ARRAY DECLARATION The general form of array declaration is: data_type array_variable-name[size]; • Data_type – specifies the type of element that will be contained in the array , such as int, char • size –indicates the maximum number of elements that can be stored inside the array.
  • 7. EXAMPLE • For example we want to represent a set of five numbers, say (10,20,30,40,50) by an array variable number, then we may declare the variable number as follows int number[5]; • and the computer reserves five storage locations as shown below: Number[0] Number[1] Number[2] Number[3] Number[4]
  • 8. ARRAY INTIALIZATION Syntax: data_type array_variable-name[SIZE]={LIST OF VALUE} EXAMPLE : int number[5]={10,20,30,40,50}; Number[0] Number[1] Number[2] Number[3] Number[4] fv 10 20 30 40 50
  • 9. MORE EXAMPLES FOR ARRAY INITIALIZATION int counter[ ]= {10,20,30,40,50}; char name[ ]= { ’J’ , ’H’ , ’O’ , ’N’ , ’0” }; alternatively, char name[ ]= “john”; //array with string int number[5]={10,20}; number[0]=10,number[1]=20, number[2]=0,number[3]=0,number[4]=0 •we can also initialize an array with scanf() function. for example, int x[5]; printf(“enter the values:”); scanf(“%d%d%d”,&x[0],&x[1],&x[2]);
  • 10. EXAMPLE PROGRAM #include<stdio.h> #include<conio.h> void main() { int a[5],sum=0,i; printf(“Enter 5 numbers”); for(i=0;i<5;i++) { scanf(“%dn”,&a[i]); sum=sum+a[i]; } printf(“the sum of given numbers is : %dn”, sum); }
  • 11. TWO DIMENSIONAL ARRAY SYNTAX: data_type array_name [row-size][column-size]; INITIAZING TWO DIMENSIONAL ARRAY: Like one dimensional arrays, two dimensional arrays can be initialized by their declaration int table[2][3] = {0,0,0,1,1,1}; will assigns the values as follows, table[0][1]=0, table[0][1]=0, table[0][2]=0, table[1][0]=1, table[1][1]=1, table[1][2]=1 the above statement can be written as int table[2][3]={{0,0,0},{1,1,1}}; also int table[2][3] = { {0,0,0}, {1,1,1} };
  • 12. Example program #include <stdio.h> main() { int m, n, i, j, first[10][10], second[10][10], sum[10][10]; printf("Enter the number of rows and columns of matrix "); scanf("%d%d", &m, &n); printf("Enter the elements of first matrixn"); for ( i = 0 ; i< m ; i++ ) for ( j = 0 ; j < n ; j++ ) scanf("%d", &first[i][j]); printf("Enter the elements of second matrixn"); for ( i = 0 ; i < m ; i++ ) for ( j = 0 ; j < n ; j++ ) scanf("%d", &second[i][j]);
  • 13. for ( i= 0 ; i < m ; i++ ) for ( j = 0 ; j< n ; j++ ) sum[i][j] = first[i][j] + second[i][j]; printf("Sum of entered matrices:-n"); for ( i= 0 ; i< m ; i++ ) { for ( j = 0 ; j < n ; j++ ) printf("%dt", sum[i][j]); printf("n"); } return 0; }
  • 14. MULTI-DIMENSIONAL ARRAY C allows arrays of more-dimensions called multi- dimensional array. The general form of a multi-dimensional array is: Type array-name[s1][s2][s3]…..[sn] Where ‘s’ is the size of the dimension int survey[3][5][2]; float table[5][4][5][3];