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

What's hot (20)

PPT
Arrays in c
vampugani
 
PPTX
Programming in c Arrays
janani thirupathi
 
PPTX
Arrays in c language
tanmaymodi4
 
PPTX
Arrays in C language
Shubham Sharma
 
PPTX
Array in c language
umesh patil
 
PPTX
Array in c programming
2569294Mohan
 
PPT
Array in c
Ravi Gelani
 
PPTX
Programming in c arrays
Uma mohan
 
PPTX
Array in (C) programing
mJafarww
 
PPTX
Arrays in c
Jeeva Nanthini
 
PPTX
Arrays basics
sudhirvegad
 
PPTX
Array in c
AnIsh Kumar
 
PDF
Arrays In C
yndaravind
 
PPTX
C++ programming (Array)
طارق بالحارث
 
PPT
C programming , array 2020
Osama Ghandour Geris
 
PPTX
Array in c language
umesh patil
 
PPTX
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 
PPTX
Arrays in c
CHANDAN KUMAR
 
PPTX
Introduction to Array ppt
sandhya yadav
 
PPTX
One dimensional arrays
Satyam Soni
 
Arrays in c
vampugani
 
Programming in c Arrays
janani thirupathi
 
Arrays in c language
tanmaymodi4
 
Arrays in C language
Shubham Sharma
 
Array in c language
umesh patil
 
Array in c programming
2569294Mohan
 
Array in c
Ravi Gelani
 
Programming in c arrays
Uma mohan
 
Array in (C) programing
mJafarww
 
Arrays in c
Jeeva Nanthini
 
Arrays basics
sudhirvegad
 
Array in c
AnIsh Kumar
 
Arrays In C
yndaravind
 
C++ programming (Array)
طارق بالحارث
 
C programming , array 2020
Osama Ghandour Geris
 
Array in c language
umesh patil
 
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 
Arrays in c
CHANDAN KUMAR
 
Introduction to Array ppt
sandhya yadav
 
One dimensional arrays
Satyam Soni
 

Similar to Array C programming (20)

PDF
Arrays
Steven Wallach
 
PDF
Array and its types and it's implemented programming Final.pdf
ajajkhan16
 
PPTX
Introduction to Array & Structure & Basic Algorithms.pptx
MrNikhilMohanShinde
 
PPTX
Abir ppt3
abir96
 
PPT
strings.ppt
satyabratPanda2
 
PPTX
ARRAY (specially for computer science students).pptx
royatanu222006
 
PPTX
Unit4pptx__2024_11_ 11_10_16_09.pptx
GImpact
 
PPTX
Arrays & Strings
Munazza-Mah-Jabeen
 
PPTX
Chapter 13.pptx
AnisZahirahAzman
 
PPTX
BHARGAVIARRAY.PPT.pptx
Sasideepa
 
PPTX
Array
Anil Dutt
 
PPTX
Arrays in c v1 09102017
Tanmay Modi
 
PDF
Arraysincv109102017 180831194256
ABHAY9616302301
 
PPTX
Module_3_Arrays - Updated.pptx............
ChiragKankani
 
PPTX
Array
HarshKumar943076
 
PPTX
Array definition and uses in computer.pptx
naushigrdcs
 
PPTX
Array.pptx
fixocin377
 
PDF
SlideSet_4_Arraysnew.pdf
HimanshuKansal22
 
Array and its types and it's implemented programming Final.pdf
ajajkhan16
 
Introduction to Array & Structure & Basic Algorithms.pptx
MrNikhilMohanShinde
 
Abir ppt3
abir96
 
strings.ppt
satyabratPanda2
 
ARRAY (specially for computer science students).pptx
royatanu222006
 
Unit4pptx__2024_11_ 11_10_16_09.pptx
GImpact
 
Arrays & Strings
Munazza-Mah-Jabeen
 
Chapter 13.pptx
AnisZahirahAzman
 
BHARGAVIARRAY.PPT.pptx
Sasideepa
 
Array
Anil Dutt
 
Arrays in c v1 09102017
Tanmay Modi
 
Arraysincv109102017 180831194256
ABHAY9616302301
 
Module_3_Arrays - Updated.pptx............
ChiragKankani
 
Array definition and uses in computer.pptx
naushigrdcs
 
Array.pptx
fixocin377
 
SlideSet_4_Arraysnew.pdf
HimanshuKansal22
 
Ad

More from Prionto Abdullah (10)

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

Recently uploaded (20)

PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
Difference between write and update in odoo 18
Celine George
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PDF
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
Difference between write and update in odoo 18
Celine George
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
epi editorial commitee meeting presentation
MIPLM
 

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