Quote:
Originally Posted by triko
But if I want put in array2 only the even or odd number???
How to do???
|
What does that mean? Do you mean only the odd/even indices (1,3,5 etc. or 0,2,4 etc.) or do you mean populate the second array only with numbers in the first array which are odd/even? (1,13,5 are odd in your example).
Surely you can guess that this would involve an if...else statement.
if (array1[i]%2 == 0) // value is even