ap kia bata sakkty hian
ap kia bata sakkty hian
jani array ko kuch save karny k liye use karty hain
array is just a structure to store data in order...
array always start form 0 indx...you may say that array is consecutive memory allocation.
also array is arithmetic base/can b filled or displayed by loop bcz of consecutive memory
array is a series of consecutive memory locations with same data type.
eg:
int array[10];
this statement will make 10 memory locations of type int in the memory,and these memory locations can be accessed through the index number which is from 0 to 9 in this case.data is usually input by usin a loop.
nice wrk
1)Array ko hum data store karne k liy use karte hain.
2) iss se data ko search karna eassy hota hai.
dear arrays ko data stroing k lye use kya jata hai lekin jb hum ne 2dimensional work karna hoo tou array is the best one to work with............
jb hum koi table mein kaaam karna chahe tou hum arrays ko use karte hain ....
for ,do-while,while, sab ma jab hum ne koi loop chalani hoti thi to us ma seraf ya result display karta tha and next result ane par pechla wala khatam ho jata tha ..jab bi hum koi esay program ki zararut pesh ati jis ma hum data index position par store karay or jab marzi chahe use dakh sakay..is maksad k liye array use hoti hay..
esmay programe ki language mai kio help nahe ki gaye kio keh raha hia k storing k liay array use hothe hia kio kuch kio kuch.tho dears thora profetional type k ans,s do na tha k hamay help milay.plz mind math krna.
variable and array both use for store data.
it is very difficult to store ages of 1000 people in variables.
but simple in array:
int age[1000];
yeh raha apka jawab......
dear array ko hum sequence ye serilization k lye istemal karte hain..
suppose ap aek school mein jate hain, ap ko aik admission form fill karne k lye diya jata hai, wesa hi admission form kisi dosray student ko dya jata hai, tou ab en k darmyan faraq kaha se karna hai k konsa form kis student ka hai? ab agar har form us student k nam se rakha jaye ga to data zyada ho jaye ga. lekin agar us ko serialize kar dya jaye like form1,form2,form3...so on..
tou hum es se jaldi search kar len ge.. kyon k humne har admisison form ko aik number laga kar student ko de dya hai.....
this is the us of array
void main()
{
int a(10);//creates 11 object like a(0),a(1)......a(10)
a(0) = 1;
a(1) = 2;
a(2) = 3;
a(3) = 4;
a(9) = 5;
a(5) = 6;
a(6) = 7;
a(7) = 8;
a(8) = 9;
a(9) = 10;
a(10) = 11;
cout<<a(0);
cout<<a(1);
cout<<a(2);
cout<<a(3);
cout<<a(4);
cout<<a(5);
cout<<a(6);
cout<<a(7);
cout<<a(8);
cout<<a(9);
cout<<a(10);
return true;
}
Bookmarks