Downloaded 24 times



![normal
variable
Int
a=10;
b=20;
c=30;
array
variable
Int
a[0]=10,
a[1]=20,
a[2]=30;](/proxy?url=https%3A%2F%2Fimage.slidesharecdn.com%2Farray-1-190515095516%2F85%2FArray-in-C-programing-4-320.jpg)


![ 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 ();
}](/proxy?url=https%3A%2F%2Fimage.slidesharecdn.com%2Farray-1-190515095516%2F85%2FArray-in-C-programing-7-320.jpg)
![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();](/proxy?url=https%3A%2F%2Fimage.slidesharecdn.com%2Farray-1-190515095516%2F85%2FArray-in-C-programing-8-320.jpg)

The document discusses arrays in C programming. It defines an array as a collection of values of the same type, with each value called an element that has a unique index number. It describes one-dimensional and multi-dimensional arrays. A one-dimensional array uses a single subscript to access elements, while a multi-dimensional array is like a table with rows and columns. Sample code is provided to demonstrate declaring and using one-dimensional and two-dimensional arrays.



![normal
variable
Int
a=10;
b=20;
c=30;
array
variable
Int
a[0]=10,
a[1]=20,
a[2]=30;](/proxy?url=https%3A%2F%2Fimage.slidesharecdn.com%2Farray-1-190515095516%2F85%2FArray-in-C-programing-4-320.jpg)


![ 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 ();
}](/proxy?url=https%3A%2F%2Fimage.slidesharecdn.com%2Farray-1-190515095516%2F85%2FArray-in-C-programing-7-320.jpg)
![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();](/proxy?url=https%3A%2F%2Fimage.slidesharecdn.com%2Farray-1-190515095516%2F85%2FArray-in-C-programing-8-320.jpg)
