ARRAYS | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

ARRAYS

pls define arrays ....with proper example...and maybe a small array program with output ( at least the definitation please

27th Dec 2016, 4:22 PM
MEDHIR
MEDHIR - avatar
3 Answers
+ 3
int a[]={1,2,3}; // dont need to mention size if we are going to declare it like this
27th Dec 2016, 5:20 PM
Doolitha Samaranayake
Doolitha Samaranayake - avatar
+ 2
Arrays are the group of many data with a single variable name and all data are stored along with an index number starting from 0. int main() { int a[3]={1,2,3} ; cout<<a[0] ; // outputs 1 cout<<a[1] ; // outputs 2 cout<<a[2] ; // outputs 3 return 0; } hope this helps
27th Dec 2016, 4:44 PM
Rishabh Agrawal
Rishabh Agrawal - avatar
+ 2
thank you for your contribution
27th Dec 2016, 4:48 PM
MEDHIR
MEDHIR - avatar