hi!
i wanna find the product of all inputs that user enter
and also user determine the length of an array
when the array size is 1000 the final product for each input is 0
and i don't know why is that
Well let's start with the obvious: are any of those 1,000 numbers zero? If so then the product will be zero.
If not then you are probably overflowing the capacity of type int. Int is typically a 32-bit signed number and so has a maximum value that's a little more than 2 billion. Unless your numbers are very small and consist mostly of 1's, the product of any 1,000 numbers will probably be larger than 2 billion.
Try copying line 17 to line just after line 13 so you print out the intermediate products. That should help you see what's going on.
If you really need to multiply so many numbers then consider making product a doubleor longdouble.
i copied line 17 after line13 every thing went ok by this input:
5
1 2 3 4 5
out:
1
2
6
24
120
even i changed the int to long long int
but doesn't work:<
i can't get point
why 1000???????