0
I want to print number of positive , negative , even ,odd number stored in array by user but I am not getting desired output
2 Answers
+ 2
Inside the conditionals, you are declaring "count1" etc. as local variables, that, while they have the same name, are different variables than the ones declared in main(), and will shadow them, i.e. inside the conditional, the name "count1" now refers to the newly created local variable, not the one from main(). If you just get rid of the redeclarations and only increment the counters when appropriate, you will get the desired output.
+ 1
Thanks I got it