SlideShare a Scribd company logo
1 of 11
WELCOME TO MY PRESENTATION
AbdullahAlYeamin
Maruf
ID: 173-35-256
Array in C programming Language
Introducing Arrays
Array is a data structure that represents a collection of the
same types of data.
An Array of 10 Elements of type int.
Declaring Array Variables
Data_type array_name [index];
Example:
float cgpa[10];
char swe[15];
int num[5];
Initialing Array Variables
Data type array name [size];
Example:
int num[5] = { 1, 2, 3, 4, 5};
int id[0] = 13;
int id[1] = 14;
int id[2] = 15;
int id[3] = 16;
int id[4] = 17;
Num [0] references the first element in the array.
Num[4] references the last element in the array.
Simple Array Program
#include<stdio.h>
int main() {
int i,sum=0;
int marks[5];
for (i=0; i<5; i++)
{
printf (“Enter marks”);
scanf (“%d”,&marks[i]);
}
for (i=0; i<5; i++)
sum = sum+marks[i];
printf(“n summation marks=%d”,sum);
return 0;
}
Two dimensional Array
A two dimensional array has two indexes. The first index
refers to the row, and the second to the column.
Declaring two dimensional Array Variables
data_type array_name [row size] [column size]
Example:
int a[3][4];
char swe[15][8];
float num[2][3];
Initialing Two-Dimensional Arrays
Multidimensional arrays may be initialized by specifying bracketed
values for each row. Following is an array with 3 rows and each
row has 4 columns.
int a[3][4] = {
{0, 1, 2, 3} ,
{4, 5, 6, 7} ,
{8, 9, 10, 11}
};
The following initialization is equivalent to the previous example −
int a[3][4] = {0,1,2,3,4,5,6,7,8,9,10,11};
Two-Dimensional Array Program
#include <stdio.h>
int main () {
/* an array with 5 rows and 2 columns*/
int a[5][2] = { {0,0}, {1,2}, {2,4}, {3,6},{4,8}};
int i, j;
/* output each array element's value */
for ( i = 0; i < 5; i++ ) {
for ( j = 0; j < 2; j++ ) {
printf("a[%d][%d] = %dn", i,j, a[i][j] );
}
}
return 0;
}
Thank You Everyone.

More Related Content

What's hot

Arrays in c language
Arrays in c languageArrays in c language
Arrays in c languagetanmaymodi4
 
Array in c language
Array in c languageArray in c language
Array in c languageumesh patil
 
Array in c programming
Array in c programmingArray in c programming
Array in c programming2569294Mohan
 
Programming in c arrays
Programming in c   arraysProgramming in c   arrays
Programming in c arraysUma mohan
 
Array in (C) programing
Array in (C) programing Array in (C) programing
Array in (C) programing mJafarww
 
Array in c language
Array in c language Array in c language
Array in c language umesh patil
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayimtiazalijoono
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array pptsandhya yadav
 
One dimensional arrays
One dimensional arraysOne dimensional arrays
One dimensional arraysSatyam Soni
 

What's hot (20)

Arrays in c
Arrays in cArrays in c
Arrays in c
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Arrays in c language
Arrays in c languageArrays in c language
Arrays in c language
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
Array in c language
Array in c languageArray in c language
Array in c language
 
Array in c programming
Array in c programmingArray in c programming
Array in c programming
 
Array in c
Array in cArray in c
Array in c
 
Programming in c arrays
Programming in c   arraysProgramming in c   arrays
Programming in c arrays
 
Array in (C) programing
Array in (C) programing Array in (C) programing
Array in (C) programing
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Arrays basics
Arrays basicsArrays basics
Arrays basics
 
Array in c
Array in cArray in c
Array in c
 
Arrays In C
Arrays In CArrays In C
Arrays In C
 
C++ programming (Array)
C++ programming (Array)C++ programming (Array)
C++ programming (Array)
 
C programming , array 2020
C programming , array 2020C programming , array 2020
C programming , array 2020
 
Array in c language
Array in c language Array in c language
Array in c language
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 
One dimensional arrays
One dimensional arraysOne dimensional arrays
One dimensional arrays
 

Similar to Array C programming (20)

Array
ArrayArray
Array
 
Chapter 7.1
Chapter 7.1Chapter 7.1
Chapter 7.1
 
Arrays in CPP
Arrays in CPPArrays in CPP
Arrays in CPP
 
Array assignment
Array assignmentArray assignment
Array assignment
 
Arrays & Strings
Arrays & StringsArrays & Strings
Arrays & Strings
 
Array
ArrayArray
Array
 
Arrays
ArraysArrays
Arrays
 
Array
ArrayArray
Array
 
Arrays-Computer programming
Arrays-Computer programmingArrays-Computer programming
Arrays-Computer programming
 
pptt.pptx
pptt.pptxpptt.pptx
pptt.pptx
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
Unit4 Slides
Unit4 SlidesUnit4 Slides
Unit4 Slides
 
2 arrays
2   arrays2   arrays
2 arrays
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
Arrays_in_c++.pptx
Arrays_in_c++.pptxArrays_in_c++.pptx
Arrays_in_c++.pptx
 
2DArrays.ppt
2DArrays.ppt2DArrays.ppt
2DArrays.ppt
 
COM1407: Arrays
COM1407: ArraysCOM1407: Arrays
COM1407: Arrays
 
C Arrays.ppt
C Arrays.pptC Arrays.ppt
C Arrays.ppt
 
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
 
Arrays
ArraysArrays
Arrays
 

More from Prionto Abdullah

Field of statistics in software engineering
Field of statistics in software engineeringField of statistics in software engineering
Field of statistics in software engineeringPrionto Abdullah
 
Codepundit Video Presentation
Codepundit Video PresentationCodepundit Video Presentation
Codepundit Video PresentationPrionto Abdullah
 
Softcademy School Management Apps
Softcademy School Management Apps Softcademy School Management Apps
Softcademy School Management Apps Prionto Abdullah
 
Application of Discrete mathematics in Real Life
Application of Discrete mathematics in Real LifeApplication of Discrete mathematics in Real Life
Application of Discrete mathematics in Real LifePrionto Abdullah
 
Village scenery graphics C programming
Village scenery graphics C programmingVillage scenery graphics C programming
Village scenery graphics C programmingPrionto Abdullah
 
Tic tac toe game with graphics presentation
Tic  tac  toe game with graphics presentationTic  tac  toe game with graphics presentation
Tic tac toe game with graphics presentationPrionto Abdullah
 

More from Prionto Abdullah (10)

Field of statistics in software engineering
Field of statistics in software engineeringField of statistics in software engineering
Field of statistics in software engineering
 
Codepundit Video Presentation
Codepundit Video PresentationCodepundit Video Presentation
Codepundit Video Presentation
 
Softcademy School Management Apps
Softcademy School Management Apps Softcademy School Management Apps
Softcademy School Management Apps
 
Java History
Java HistoryJava History
Java History
 
Application of Discrete mathematics in Real Life
Application of Discrete mathematics in Real LifeApplication of Discrete mathematics in Real Life
Application of Discrete mathematics in Real Life
 
Java presentation
Java presentationJava presentation
Java presentation
 
String C Programming
String C ProgrammingString C Programming
String C Programming
 
English
English English
English
 
Village scenery graphics C programming
Village scenery graphics C programmingVillage scenery graphics C programming
Village scenery graphics C programming
 
Tic tac toe game with graphics presentation
Tic  tac  toe game with graphics presentationTic  tac  toe game with graphics presentation
Tic tac toe game with graphics presentation
 

Recently uploaded

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
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
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🔝
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
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
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
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 🔝✔️✔️
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Array C programming

  • 1. WELCOME TO MY PRESENTATION AbdullahAlYeamin Maruf ID: 173-35-256
  • 2. Array in C programming Language
  • 3. Introducing Arrays Array is a data structure that represents a collection of the same types of data. An Array of 10 Elements of type int.
  • 4. Declaring Array Variables Data_type array_name [index]; Example: float cgpa[10]; char swe[15]; int num[5];
  • 5. Initialing Array Variables Data type array name [size]; Example: int num[5] = { 1, 2, 3, 4, 5}; int id[0] = 13; int id[1] = 14; int id[2] = 15; int id[3] = 16; int id[4] = 17; Num [0] references the first element in the array. Num[4] references the last element in the array.
  • 6. Simple Array Program #include<stdio.h> int main() { int i,sum=0; int marks[5]; for (i=0; i<5; i++) { printf (“Enter marks”); scanf (“%d”,&marks[i]); } for (i=0; i<5; i++) sum = sum+marks[i]; printf(“n summation marks=%d”,sum); return 0; }
  • 7. Two dimensional Array A two dimensional array has two indexes. The first index refers to the row, and the second to the column.
  • 8. Declaring two dimensional Array Variables data_type array_name [row size] [column size] Example: int a[3][4]; char swe[15][8]; float num[2][3];
  • 9. Initialing Two-Dimensional Arrays Multidimensional arrays may be initialized by specifying bracketed values for each row. Following is an array with 3 rows and each row has 4 columns. int a[3][4] = { {0, 1, 2, 3} , {4, 5, 6, 7} , {8, 9, 10, 11} }; The following initialization is equivalent to the previous example − int a[3][4] = {0,1,2,3,4,5,6,7,8,9,10,11};
  • 10. Two-Dimensional Array Program #include <stdio.h> int main () { /* an array with 5 rows and 2 columns*/ int a[5][2] = { {0,0}, {1,2}, {2,4}, {3,6},{4,8}}; int i, j; /* output each array element's value */ for ( i = 0; i < 5; i++ ) { for ( j = 0; j < 2; j++ ) { printf("a[%d][%d] = %dn", i,j, a[i][j] ); } } return 0; }