0

C++ array

If we have an int array with 6 elements in it. Then we create two empty int arrays. How we can populate these two arrays with elements of the first array. I want that even items (indexes) will be in one, and odds(indexes) in the other array. So each array will therefore have 3 elements of the first one with 6 elements?

10th May 2021, 1:09 PM
TeaserCode
2 Respuestas
+ 3
What you can do take 3 indexes one for original, one for even one and one for odd now use the original array index as it is but evry time you insert in odd one then increment odd index and for even increment even index and also put that number in that Index
10th May 2021, 1:31 PM
YUGRAJ