SlideShare a Scribd company logo
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

PDF
SPL 10 | One Dimensional Array in C
PPTX
Array in-c
PPTX
Array in C
PPTX
Array in c programming
PPTX
Basic array in c programming
PPTX
C++ lecture 04
PPTX
Array in c language
SPL 10 | One Dimensional Array in C
Array in-c
Array in C
Array in c programming
Basic array in c programming
C++ lecture 04
Array in c language

What's hot (20)

PPT
Arrays in c
PPTX
Programming in c Arrays
PPTX
Arrays in c language
PPTX
Arrays in C language
PPTX
Array in c language
PPTX
Array in c programming
PPT
Array in c
PPTX
Programming in c arrays
PPTX
Array in (C) programing
PPTX
Arrays in c
PPTX
Arrays basics
PPTX
Array in c
PDF
Arrays In C
PPTX
C++ programming (Array)
PPT
C programming , array 2020
PPTX
Array in c language
PPTX
Array Introduction One-dimensional array Multidimensional array
PPTX
Arrays in c
PPTX
Introduction to Array ppt
PPTX
One dimensional arrays
Arrays in c
Programming in c Arrays
Arrays in c language
Arrays in C language
Array in c language
Array in c programming
Array in c
Programming in c arrays
Array in (C) programing
Arrays in c
Arrays basics
Array in c
Arrays In C
C++ programming (Array)
C programming , array 2020
Array in c language
Array Introduction One-dimensional array Multidimensional array
Arrays in c
Introduction to Array ppt
One dimensional arrays
Ad

Similar to Array C programming (20)

PPT
PPT
Lecture 15 Arrays with C++ programming.ppt
PPTX
Chapter 7.1
PPTX
Arrays in CPP
DOCX
Array assignment
PPTX
Arrays & Strings
PPTX
Arrays
PPTX
Array and its operation in C programming
PDF
Arrays-Computer programming
PPTX
PPT
Fp201 unit4
PPT
2 arrays
PPTX
Arrays in C++
PPTX
Arrays_in_c++.pptx
PPT
2DArrays.ppt
PPTX
COM1407: Arrays
PPTX
arrays in c programming - example programs
Lecture 15 Arrays with C++ programming.ppt
Chapter 7.1
Arrays in CPP
Array assignment
Arrays & Strings
Arrays
Array and its operation in C programming
Arrays-Computer programming
Fp201 unit4
2 arrays
Arrays in C++
Arrays_in_c++.pptx
2DArrays.ppt
COM1407: Arrays
arrays in c programming - example programs
Ad

More from Prionto Abdullah (10)

PPTX
Field of statistics in software engineering
PPTX
Codepundit Video Presentation
PPTX
Softcademy School Management Apps
PPTX
Java History
PPTX
Application of Discrete mathematics in Real Life
PPTX
Java presentation
PPTX
String C Programming
PPTX
PPTX
Village scenery graphics C programming
PPTX
Tic tac toe game with graphics presentation
Field of statistics in software engineering
Codepundit Video Presentation
Softcademy School Management Apps
Java History
Application of Discrete mathematics in Real Life
Java presentation
String C Programming
Village scenery graphics C programming
Tic tac toe game with graphics presentation

Recently uploaded (20)

PPTX
Onica Farming 24rsclub profitable farm business
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Cell Structure & Organelles in detailed.
PPTX
Pharma ospi slides which help in ospi learning
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
PSYCHOLOGY IN EDUCATION.pdf ( nice pdf ...)
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Business Ethics Teaching Materials for college
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Pre independence Education in Inndia.pdf
PPTX
Introduction and Scope of Bichemistry.pptx
Onica Farming 24rsclub profitable farm business
Microbial diseases, their pathogenesis and prophylaxis
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Anesthesia in Laparoscopic Surgery in India
STATICS OF THE RIGID BODIES Hibbelers.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Cell Structure & Organelles in detailed.
Pharma ospi slides which help in ospi learning
Microbial disease of the cardiovascular and lymphatic systems
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PSYCHOLOGY IN EDUCATION.pdf ( nice pdf ...)
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Open Quiz Monsoon Mind Game Final Set.pptx
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Business Ethics Teaching Materials for college
human mycosis Human fungal infections are called human mycosis..pptx
Pre independence Education in Inndia.pdf
Introduction and Scope of Bichemistry.pptx

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; }