CM304
CM304
ANDHRA PRADESH
Name of the faculty : K. Jeevan Kumar.
Designation : Lecturer.
Branch : Computer Engineering.
Institute : V.K.R & V.N.B Polytechnic Gudivada.
Year/Semester : III Semester
Subject : UNIX & C
Subject Code : CM-304
Topic : Understand basics of Arrays.
Duration : 50 Min
Sub Topic : Array Declaration.
Teaching Aids : Diagram and animations, PPTs.
CM304.56 1
Objective
CM304.56 2
Types of Arrays
One-dimensional array.
Two dimensional array.
Three dimensional array.
CM304.56 3
Declaration of Array
datatype array_name[size];
CM304.56 4
One-dimensional array
Definition:
Whose elements are specified by one subscript
that array is called One-dimensional array.
CM304.56 5
Simple program using one-dimensional array
#include<stdio.h> Data type
Variable name
main( )
{
int marks[5]; Array size
int i;
printf (“enter the marks”);
for(i =0;i<5;i++)
{
scanf (“%d”, &marks[ i ]);
printf (“the entered marks is %d \n”, marks[ i ] );
}
} CM304.56 6
Summary
CM304.56 7
Quiz
1.Types of arrays….?
a) one dimensional
b) two dimensional
c) three dimensional
d) all of the above.
CM304.56 8
Quiz
1.Types of arrays….?
a) one dimensional
b) two dimensional
c) three dimensional
d) all of the above.
CM304.56 9
Quiz
CM304.56 10
Quiz
CM304.56 11
Quiz
CM304.56 12
Quiz
CM304.56 13
Frequently Asked Questions
CM304.56 14