I have for example this array: And I want to find the last number of the array different to 0. In this case, my output should be: 9.0 My code is: But it doesn’t work. I need to highlight that the size of the array1 is always the same. But the non-zero numbers can change, in any case, all the
Tag: zero
How do I check if my int array is empty, with the standard value being 0?
So I have come across an issue I do not seem to be able to fix. So lets say I have an int array and want to check whether the array still has space to add a certain element (from 0-∞) or has no space left, which would mean I would need to create a new array. The issue is
All array combinations with zero in a loop
The following array is given I now want to loop to output all combinations of these numbers with 0. Each number can occur alone or with any other numbers in the array (the rest should be 0). The original position of the numbers should be maintained when they are included in a combination. The numbers of the original array should