what for an array is used in a program..??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what for an array is used in a program..???

25th Jul 2016, 4:10 AM
akshitha rayudu
akshitha rayudu - avatar
3 Answers
+ 2
arrays are used to store multiple data which are to be held together.. for example if u want to store all the family members name in a single variable then u can use array..
25th Jul 2016, 4:49 AM
mahi
+ 2
arrays are needed to store multiple data of the same type together. you can have different types of arrays, like integer, string, character, etc. as per your need. suppose you want to add 3 numbers. instead of taking the inputs in a, b and c, you can put it in an integer array which can hold 3 numbers. then easily access them using array index and apply addition process.
27th Jul 2016, 7:55 PM
Kaushik Gaurav
Kaushik Gaurav - avatar
+ 2
arrays hold elements of similar data types. you can't store elements of different types in a single array. I.e. you can have an integer array, string array, double array .... but not combined.
30th Jul 2016, 2:52 PM
sameer
sameer - avatar