I want perform an operation on some elements of an array, but I don't know how I can exclude some and include some. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I want perform an operation on some elements of an array, but I don't know how I can exclude some and include some.

For example, I have an array declared as int a[]=new int[20] And I have saved something in the 20 array elements. If I want to add something or check something from some of the elements without doing it on others, how can I go about it?

30th Nov 2019, 8:16 AM
Mutiu Olagoke
Mutiu Olagoke - avatar
1 Answer
+ 3
You can access that particular element using it's index position to alter or to check for the value.
30th Nov 2019, 8:27 AM
Avinesh
Avinesh - avatar