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

PDF
Python set
PPSX
Functional dependency
PPTX
Stack and Queue by M.Gomathi Lecturer
PPTX
Searching and sorting
PPT
Structure in C
PPTX
Pointers in c++
PPT
Array in Java
PDF
Array data structure
Python set
Functional dependency
Stack and Queue by M.Gomathi Lecturer
Searching and sorting
Structure in C
Pointers in c++
Array in Java
Array data structure

What's hot (20)

PPTX
Polymorphism and its types
PPTX
Dynamic data structures
PPTX
Function overloading and overriding
PPTX
Functions in c++
PDF
Lecture Notes Unit4 Chapter13 users , roles and privileges
PPTX
Structure in c language
PPTX
2D Array
PPTX
Strings in C
PPTX
Arrays in c
PPTX
PPT
C++ Arrays
PPTX
Entity Relationship Diagram – ER Diagram in DBMS.pptx
PPTX
C data types, arrays and structs
PPT
TCP IP Addressing
PPT
Data structure
PPT
Basic networking hardware: Switch : Router : Hub : Bridge : Gateway : Bus : C...
PPT
File handling in c
PPSX
Fixed point and floating-point numbers
PPT
Linked List
PDF
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Polymorphism and its types
Dynamic data structures
Function overloading and overriding
Functions in c++
Lecture Notes Unit4 Chapter13 users , roles and privileges
Structure in c language
2D Array
Strings in C
Arrays in c
C++ Arrays
Entity Relationship Diagram – ER Diagram in DBMS.pptx
C data types, arrays and structs
TCP IP Addressing
Data structure
Basic networking hardware: Switch : Router : Hub : Bridge : Gateway : Bus : C...
File handling in c
Fixed point and floating-point numbers
Linked List
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Ad

Similar to Array in (C) programing (20)

PPTX
ch 7 single dimension array in oop .pptx
PPTX
Arrays in Data Structure and Algorithm
PPTX
ARRAYS IN C.pptx
PDF
Chapter 13.1.7
PPT
Chap09
PPT
19-Lec - Multidimensional Arrays.ppt
PPTX
Introduction to array and string
PPT
presentation_arrays_1443553113_140676.ppt
PPTX
Data types in python
PPTX
PDF
Array
PPT
2 arrays
PPTX
PPSX
C Programming : Arrays
PPT
Arrays in JAVA.ppt
PPT
Strings Arrays
PPT
07 Arrays
PPT
Java: Introduction to Arrays
PPTX
One dimensional arrays
ch 7 single dimension array in oop .pptx
Arrays in Data Structure and Algorithm
ARRAYS IN C.pptx
Chapter 13.1.7
Chap09
19-Lec - Multidimensional Arrays.ppt
Introduction to array and string
presentation_arrays_1443553113_140676.ppt
Data types in python
Array
2 arrays
C Programming : Arrays
Arrays in JAVA.ppt
Strings Arrays
07 Arrays
Java: Introduction to Arrays
One dimensional arrays
Ad

Recently uploaded (20)

PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
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 Đ...
PDF
Basic Mud Logging Guide for educational purpose
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
Insiders guide to clinical Medicine.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Complications of Minimal Access Surgery at WLH
PDF
01-Introduction-to-Information-Management.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Lesson notes of climatology university.
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Basic Mud Logging Guide for educational purpose
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Pharma ospi slides which help in ospi learning
Insiders guide to clinical Medicine.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
Microbial diseases, their pathogenesis and prophylaxis
102 student loan defaulters named and shamed – Is someone you know on the list?
Complications of Minimal Access Surgery at WLH
01-Introduction-to-Information-Management.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Lesson notes of climatology university.
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Renaissance Architecture: A Journey from Faith to Humanism

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();