SlideShare a Scribd company logo
ARRAYS
Name – BHAGWAN SAHAY JANGID
B.TECH FIRST YEAR (C.S.)
INTRODUCING ARRAYS :-
• An array is a collection of variables of
the same type that are referred to
through a common name.
Int num [3];
Num reference —: num[0]
num[1]
num[2]
• Data type array name [index];
• Example :-
• Int list [10];
• Char num [15];
• Float hat [20];
DECLARING ARRAY VARIABLES :-
CREATING ARRAYS :-
• Data type array _name [size];
• Example :
• Int num [10];
• Num [0] references the first element in the
array.
DIFFERENT TYPES OF ARRAYS :-
•ONE-DIMENSIONAL ARRAY
•TWO-DIMENSIONAL ARRAY
•MULTI-DIMENSIONAL ARRAY
ONE-DIMENSIONAL ARRAYS :-
•One dimensional array have only one subscript
under a common name.
•Syntax
•Data _type array_name [array_size];
•Example :-
•Int age [5]; ={2,3,4,5,6};
EXAMPLE PROGRAM :-
• # include <stdio.h>
• # include <conio.h>
• Int main ()
• {
int a[4];
int I ;
for (i=0; i<4 ; i++)
{
scanf(“%d”,& a[i]);
}
for (i=0 ; i<4; i++)
printf (“a[%d]=%d/n”,I, a[i]);
return 0;
}
TWO-DIMENSIONAL ARRAYS :-
•Two – dimensional array are those type of array.
Which has finite number of rows and finite number of
columns. 2D arrays are generally known as matrix.
•Data _type Array _name [row size ][columnsize];
EXAMPLE PROGRAM :-
• # include <stdio.h>
# include<conio.h>
into main()
{
int disp [3][4];
int I, j ;
for (i=0; i<=2; i++)
{
for (j=0; j<=4; j++)
}
printf (“Enter value for disp [%d][%d][%d]”,I, j);
scanf (“%d”,&disp [i] [ j]);
}
}
return 0;
}
MULTI-DIMENSIONAL ARRAYS :-
•An array have multiple subscript under a common
name.
•Syntax
•Type name [size][size]…..[size];
•Example :-
•Float a[2][6][8][4]…..[n];
EXAMPLE PROGRAM :-
int matrix [10][10];
{
for(i=0; i<10; i++)
for(j=0; j<10; j++)
{
matrix[i][ j] = i×j;
}
float mat [5][5];
THANK YOU

More Related Content

PPTX
Array in c programming
PPTX
Array in c programming
PPTX
Basic array in c programming
PPTX
Array in (C) programing
PPTX
Arrays In C Language
PPTX
Array in-c
PPTX
Arrays in c language
PPTX
Array in C
Array in c programming
Array in c programming
Basic array in c programming
Array in (C) programing
Arrays In C Language
Array in-c
Arrays in c language
Array in C

What's hot (20)

PPTX
Arrays in c
PPTX
Arrays in c
PPTX
Array C programming
PPT
Arrays in c
PPTX
Introduction to Array ppt
PPT
Array in c
PPTX
Array in c
PDF
SPL 10 | One Dimensional Array in C
PPTX
Presentation on array
PPTX
Array in c language
PPTX
Array in C
PPTX
Array in c
PPTX
arrays in c
PPT
Arrays Basics
PPTX
concept of Array, 1D & 2D array
PPTX
PDF
Arrays In C
PPTX
Programming in c arrays
PPTX
Array in c++
PPTX
C++ lecture 04
Arrays in c
Arrays in c
Array C programming
Arrays in c
Introduction to Array ppt
Array in c
Array in c
SPL 10 | One Dimensional Array in C
Presentation on array
Array in c language
Array in C
Array in c
arrays in c
Arrays Basics
concept of Array, 1D & 2D array
Arrays In C
Programming in c arrays
Array in c++
C++ lecture 04
Ad

Similar to Array in c programming (20)

PPTX
BHARGAVIARRAY.PPT.pptx
PPTX
Ppt on arrays in c
PPTX
PPTX
Array in c language
PPTX
Basics of array.pptx
PPTX
array-160309152651.pptx
PPTX
Array , Structure and Basic Algorithms.pptx
PPTX
Unit 6. Arrays
PPTX
Introduction to Array & Structure & Basic Algorithms.pptx
PPTX
Array in c language
PPTX
Array in c language
PPT
uderstanding arrays and how to declare arrays
PPT
L10 array
PPTX
C-Programming Arrays.pptx
PPTX
C-Programming Arrays.pptx
PPTX
PPTX
lec 2- array declaration and initialization.pptx
PPTX
Arrays in Data Structure and Algorithm
PPT
Arrays
PPT
C++ Arrays
BHARGAVIARRAY.PPT.pptx
Ppt on arrays in c
Array in c language
Basics of array.pptx
array-160309152651.pptx
Array , Structure and Basic Algorithms.pptx
Unit 6. Arrays
Introduction to Array & Structure & Basic Algorithms.pptx
Array in c language
Array in c language
uderstanding arrays and how to declare arrays
L10 array
C-Programming Arrays.pptx
C-Programming Arrays.pptx
lec 2- array declaration and initialization.pptx
Arrays in Data Structure and Algorithm
Arrays
C++ Arrays
Ad

Recently uploaded (20)

PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
PPT on Performance Review to get promotions
PPTX
UNIT 4 Total Quality Management .pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Internet of Things (IOT) - A guide to understanding
Foundation to blockchain - A guide to Blockchain Tech
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Model Code of Practice - Construction Work - 21102022 .pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPT on Performance Review to get promotions
UNIT 4 Total Quality Management .pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Lecture Notes Electrical Wiring System Components
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Internet of Things (IOT) - A guide to understanding

Array in c programming

  • 1. ARRAYS Name – BHAGWAN SAHAY JANGID B.TECH FIRST YEAR (C.S.)
  • 2. INTRODUCING ARRAYS :- • An array is a collection of variables of the same type that are referred to through a common name. Int num [3]; Num reference —: num[0] num[1] num[2]
  • 3. • Data type array name [index]; • Example :- • Int list [10]; • Char num [15]; • Float hat [20]; DECLARING ARRAY VARIABLES :-
  • 4. CREATING ARRAYS :- • Data type array _name [size]; • Example : • Int num [10]; • Num [0] references the first element in the array.
  • 5. DIFFERENT TYPES OF ARRAYS :- •ONE-DIMENSIONAL ARRAY •TWO-DIMENSIONAL ARRAY •MULTI-DIMENSIONAL ARRAY
  • 6. ONE-DIMENSIONAL ARRAYS :- •One dimensional array have only one subscript under a common name. •Syntax •Data _type array_name [array_size]; •Example :- •Int age [5]; ={2,3,4,5,6};
  • 7. EXAMPLE PROGRAM :- • # include <stdio.h> • # include <conio.h> • Int main () • { int a[4]; int I ; for (i=0; i<4 ; i++) { scanf(“%d”,& a[i]); } for (i=0 ; i<4; i++) printf (“a[%d]=%d/n”,I, a[i]); return 0; }
  • 8. TWO-DIMENSIONAL ARRAYS :- •Two – dimensional array are those type of array. Which has finite number of rows and finite number of columns. 2D arrays are generally known as matrix. •Data _type Array _name [row size ][columnsize];
  • 9. EXAMPLE PROGRAM :- • # include <stdio.h> # include<conio.h> into main() { int disp [3][4]; int I, j ; for (i=0; i<=2; i++) { for (j=0; j<=4; j++) } printf (“Enter value for disp [%d][%d][%d]”,I, j); scanf (“%d”,&disp [i] [ j]); } } return 0; }
  • 10. MULTI-DIMENSIONAL ARRAYS :- •An array have multiple subscript under a common name. •Syntax •Type name [size][size]…..[size]; •Example :- •Float a[2][6][8][4]…..[n];
  • 11. EXAMPLE PROGRAM :- int matrix [10][10]; { for(i=0; i<10; i++) for(j=0; j<10; j++) { matrix[i][ j] = i×j; } float mat [5][5];