Array ek programming concept hai
jisme aap ek se adhik values ko ek hi
variable mein store kar sakte hain.
Isme har value ko ek unique index
assign hota hai, jisse aap unhe asani se
access kar sakte hain. Yeh ek tarah se
ek list ki tarah hota hai jisme aap alag-
alag prakar ki values ko ek saath rakh
sakte hain.
Zarur! Sochiye aapke paas ek kitabon
ka dabba hai, jisme alag-alag kitabein
rakhi hui hain. Har kitab ki ek alag
number se label hoti hai, jisse aap us
kitab ko asani se dhund sakte hain.
Array bhi isi tarah ka concept hai,
lekin programming mein use hota hai.
Programming mein, array ek data
structure hota hai jisme aap multiple
values ko ek saath store kar sakte hain.
Har value ko ek unique index se
represent kiya jata hai. Index 0 se
shuru hota hai aur har value ko ek
dusre se alag index milta hai. Isse aap
values ko access, modify aur
manipulate kar sakte hain.
For example, agar aap ek array mein 5
numbers store karte hain: [10, 20, 30,
40, 50], toh yeh array 5 values ko store
kar raha hai aur har value ko ek index
se represent kiya gaya hai:
Index 0: 10
Index 1: 20
Index 2: 30
Index 3: 40
Index 4: 50
Is tarike se aapko har value ko uska
index maloom hota hai, jisse aap unhe
access kar sakte hain, jaise ki array[2]
se aapko 30 milega.
Array ka use data ko organize karne
aur asani se manage karne mein hota
hai, jaise ki list of numbers, names, ya
other types of data.
0 Comments