Finding (positive - negative - odd - even - zero) numbers in an array

Welcome again to a new lesson and a new example. We're continuing practicing what we learned in the conceptual lesson about arrays ( Taking inputs from the user, storing them in a (1D-2D-3D) array and printing them on the screen in c++ ). In today's example, we make a simple program in C++ that searches a one-dimensional array for some specific numbers and returns the count of numbers that matches the specified type. The question says: Take 20 integer inputs from the user and output the count of the following: 1. Positive numbers. 2. Negative numbers. 3. Odd numbers. 4. Even numbers. 5. Zeros. Step 1: Declare a 20-element one-dimensional array. int array[20]; Step 2: Prompt the user to enter 20 integer values and store them in the previously declared array - use a ( for ) loop to pass through the array indexes. std::cout << "Enter twenty integers:\n"; for (int i = 0; i < 20; i++) { ...