When I am initializing a variable to zero, like int i=0
, it throws an exception:
Attempt to divide by zero
How is this possible? The exception is thrown in other cases, also, like getting zero indexed value from a collection: collection[0]
, and if(a%b==0)
etc,.
Please suggest how I can deal with this.