How do I multiply the elements of an array? What am I doing wrong?
For example, if I have:
int numbers[]={1,2,2,4,5,6};
and my card_block is 2, the remainder would give 1x4x5x6 = 120;
int countCards(int [] cards, int BLOCK_CARD){
int quant=0;
int count =0;
for (int i=0; i<cards.length; i++){
if(cards[i]!=BLOCK_CARD)
count=cards[i];
count=count*cards[i];
quant=count;
}
return quant;
}