I have an array with negative positive and 3 zeros, array length =13. So I need to put the neg values and positive in 2 other array. Cout zeros but not return them. Also show doubles and how many time are they present in the initial array.
With a basic if else :
initialize 3 arrays, take input by scanner into one array. you can use for loop as you have fixed length 13.
Again use loop to traverse elements, and check if greater than zero (>0) assign to 2nd array, if less than zero, assign to 3rd array. Else increment a zero counter variable.
After loop completion you have 2 arrays as you required. You half done.
To count how many repeated, similar to above compare array elements with subsequent element if they same, increment counter, remove the element with assigning zero instead.
This can need code more with if else and loops, can be simplified with advance topics like bitset.. If you know go with that..
Hoping this gives some idea, (As you asking to start point...).. Come with code if don't get.
Cristina Dan So just see whether I have got the question right. You have to separate the positive and negative values and store them in 2 separate arrays. You also have to count the number of zeros. Also check whether a number is repeating in the array and if so than how many times.
Did I get the question right?