Uploaded by Aqib Bashir

ARRAYS AND FUNCTIONS

advertisement
1)FAIZAN KHAKI (1924CUKMR10)
2)UZAIR IRSHAD JAD
(1924CUKMR32)
3)BASIT SHAFI KHAN
(1924CUKMR07)
4)MOHAMMAD YASEEN
KUTHO(1924CUKMR18)
5)MUNEEB
MUZAFFER(1924CUKMR40)









ARRAY IS A FIXED SIZED SEQUENCED COLLECTION OF THE
ELEMENTS OF THE SAME TYPE OF DATA
IT IS SIMPLE A GROUPING OF LIKE TYPE DATA. IN ITS SIMPLE
FORM , AN ARRAY CAN BE USED TO REPRESENT THE LIST OF
NUMBERS OR A LIST5 OF NAME
SOME EXAMPLES WHERE THE CONCEPT OF ARRAYS CAN BE
USED ARE AS UNDER
1)LISTR OF TEMPERATURE RECORDED EVERY HOUR IN A DAY ,
OR MONTH ,OR A YEAR
2)LIST OF EMPLOYES IN AN ORGANISATION
3)LIST OF PRODUCT AND THEIR COST SOLD BY STORE
4)LIST OF COUSTEMERS AND THEIR TELEPHONE NUMBERS .
ARRAY PROVIDES A CONVENTIONAL STRUCTURE FOR
REPRESENTING DATA HENCE IT IS CLASSIFIED AS ONE OF THE
DATA STRUCTURE IN C




BASED ON THE BASIC OF DIMENTION
THERE ARE THREE TYPES OF ARRAYS
1)ONE DIMENTIONAL ARRAYS
2)TWO DIMENTIONAL ARRAYS
3)MULTI DIMENTIONAL ARRAYS





THE COLLECTION OF DATA ITEMS CAN BE
STORED UNDER A VARIABLE NAME USING ONLY
ONE SUBSCRIPT.
ARRAY DECLARATION
DATA TYPE SPECIFICES THE TYPE OF ELEMENT
THAT WILL BE CONTAINED IN THE ARRAY SHUC
AS INT CHAR
SIZE INDICATES THE VTHE MAXIMUM NUMBER
OF ELEMENTS THAT CAN BE STORED
INSIDE THE ARRAY









LIKE ONE DIMENTIONAL ARRAY TWO
SDIMENTIONAL ARRAY CAN BEINITIALIZED BY
THEIR DECLEARATION
INT TABLE [2][3]={0,0,0,1,1,1};
WILL ASSIGN THE VALUE AS FOLLOWS
TABLE[0][1]=0, TABLE [0][1]=0, TABLE[0][2]=0
TABLE[1][0]=1, TABLE [1][1]=1 ,TABLE[1][2]=1
THE ABOVE STATEMENT CAN BE WRITTEN AS
INT TABLE [1][3]={{0,0,0},{1,1,1};
ALSO
INT TABLE [2][3]={
{0,0,0},
{1,1,1}
};






C ALLLOWS ARRAYS OF MORE
DIMRENTIONAL CALLAD MULTI
DIMENSIONL ARRAY
THE GENERAL FORM OF MULTI –
DIMENSIONAL ARRAY IS
TYPE ARRAY NAME [S1][S2][S3]……..[Sn]
Where ‘s’ is the size of the dimentional
int survey [3][5][2]
float table [5][4][5][3];
Download