SlideShare a Scribd company logo
1 of 9
 Presented
By
Mohsin jafaree
Shaheed Benazir Bhutto university
 Array
 Types of Array
 Program example
 An array is a collection of one or more values of the
same type. Each value is called an element of
the array. The elements of the array share the same
variable name but each element has its own unique
index number (also known as a subscript). An
array can be of any type,
 For example: int , float , char etc.
normal
variable
Int
a=10;
b=20;
c=30;
array
variable
Int
a[0]=10,
a[1]=20,
a[2]=30;
Variable type Size of array
Name of array
 1. one dimensional Array
 2. multi dimensional Array
 A one-dimensional
array (or single dimension
array) is a type of
linear array. Accessing its
elements involves
a single subscript which can
either represent a row or
column index.
 Include<stdio.h>
 Include<conio.h>
 Void main()
 {
 int sub[6],sum. a;
 For (a=0; a<6; a++)
 {
 Printf (“n enter marks”);
 Scanf(“%d”&,sub[a]);
 }
 Sum:
sub[0]+sub[1]+sub[2]+sub[
3]
 +sub[4]+sub[5]
 Printf(“total marks % d”,
sum);
 getch ();
 }
Multi
dimensional
array
The two
dimensional (2D) array
in C programming is also
known as matrix. A matrix
can be represented as a
table of rows and columns
 Include<iostrem.h>
 Include<conio.h>
 Void main()
 { Int ma[3][3],mb[3][3],mc[3][3];
 Int a,b;
 For(a=0; a<3; a++)
 For (b=0; b< 1; b++)
 Scanf(“%d”, & ma[a][b]);
 For(a=0; a<3; a++)
 For (b=0; b< 1; b++)
 Scanf(“%d”, & ma[a][b]);
 For(a=0; a<3; a++)
 For (b=0; b< 1; b++)
 Scanf(“%d”, & mb[a][b]);
 mc[a][b]=ma[a][b]+mb[a][b];
 For(a=0; a<3; a++)
 For (b=0; b< 1; b++)
 printf(“%d”, mc[a][b]);
 Getch();
Array in (C) programing

More Related Content

What's hot (20)

Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
Array
ArrayArray
Array
 
Arrays
ArraysArrays
Arrays
 
Python list
Python listPython list
Python list
 
Array in-c
Array in-cArray in-c
Array in-c
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Arrays in java language
Arrays in java languageArrays in java language
Arrays in java language
 
Java arrays
Java arraysJava arrays
Java arrays
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
String Manipulation in Python
String Manipulation in PythonString Manipulation in Python
String Manipulation in Python
 
2D Array
2D Array 2D Array
2D Array
 
Arrays In C Language
Arrays In C LanguageArrays In C Language
Arrays In C Language
 
Data types in C language
Data types in C languageData types in C language
Data types 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
 
Python lists &amp; sets
Python lists &amp; setsPython lists &amp; sets
Python lists &amp; sets
 
One dimensional 2
One dimensional 2One dimensional 2
One dimensional 2
 
Presentation on array
Presentation on array Presentation on array
Presentation on array
 
ARRAY
ARRAYARRAY
ARRAY
 
Arrays
ArraysArrays
Arrays
 

Similar to Array in (C) programing

Similar to Array in (C) programing (20)

Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
Arrays
ArraysArrays
Arrays
 
ARRAYS IN C.pptx
ARRAYS IN C.pptxARRAYS IN C.pptx
ARRAYS IN C.pptx
 
Chapter 13.1.7
Chapter 13.1.7Chapter 13.1.7
Chapter 13.1.7
 
Chap09
Chap09Chap09
Chap09
 
19-Lec - Multidimensional Arrays.ppt
19-Lec - Multidimensional Arrays.ppt19-Lec - Multidimensional Arrays.ppt
19-Lec - Multidimensional Arrays.ppt
 
Introduction to array and string
Introduction to array and stringIntroduction to array and string
Introduction to array and string
 
presentation_arrays_1443553113_140676.ppt
presentation_arrays_1443553113_140676.pptpresentation_arrays_1443553113_140676.ppt
presentation_arrays_1443553113_140676.ppt
 
Data types in python
Data types in pythonData types in python
Data types in python
 
Arrays
ArraysArrays
Arrays
 
Array
ArrayArray
Array
 
2 arrays
2   arrays2   arrays
2 arrays
 
Array
ArrayArray
Array
 
C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : Arrays
 
Arrays in JAVA.ppt
Arrays in JAVA.pptArrays in JAVA.ppt
Arrays in JAVA.ppt
 
Strings Arrays
Strings ArraysStrings Arrays
Strings Arrays
 
07 Arrays
07 Arrays07 Arrays
07 Arrays
 
Java: Introduction to Arrays
Java: Introduction to ArraysJava: Introduction to Arrays
Java: Introduction to Arrays
 
One dimensional arrays
One dimensional arraysOne dimensional arrays
One dimensional arrays
 
02 arrays
02 arrays02 arrays
02 arrays
 

Recently uploaded

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
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
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
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Recently uploaded (20)

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 ...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).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
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.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
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

Array in (C) programing

  • 1.  Presented By Mohsin jafaree Shaheed Benazir Bhutto university
  • 2.  Array  Types of Array  Program example
  • 3.  An array is a collection of one or more values of the same type. Each value is called an element of the array. The elements of the array share the same variable name but each element has its own unique index number (also known as a subscript). An array can be of any type,  For example: int , float , char etc.
  • 5. Variable type Size of array Name of array
  • 6.  1. one dimensional Array  2. multi dimensional Array
  • 7.  A one-dimensional array (or single dimension array) is a type of linear array. Accessing its elements involves a single subscript which can either represent a row or column index.  Include<stdio.h>  Include<conio.h>  Void main()  {  int sub[6],sum. a;  For (a=0; a<6; a++)  {  Printf (“n enter marks”);  Scanf(“%d”&,sub[a]);  }  Sum: sub[0]+sub[1]+sub[2]+sub[ 3]  +sub[4]+sub[5]  Printf(“total marks % d”, sum);  getch ();  }
  • 8. Multi dimensional array The two dimensional (2D) array in C programming is also known as matrix. A matrix can be represented as a table of rows and columns  Include<iostrem.h>  Include<conio.h>  Void main()  { Int ma[3][3],mb[3][3],mc[3][3];  Int a,b;  For(a=0; a<3; a++)  For (b=0; b< 1; b++)  Scanf(“%d”, & ma[a][b]);  For(a=0; a<3; a++)  For (b=0; b< 1; b++)  Scanf(“%d”, & ma[a][b]);  For(a=0; a<3; a++)  For (b=0; b< 1; b++)  Scanf(“%d”, & mb[a][b]);  mc[a][b]=ma[a][b]+mb[a][b];  For(a=0; a<3; a++)  For (b=0; b< 1; b++)  printf(“%d”, mc[a][b]);  Getch();