#include using namespace std; int main() { int arr[9] = {9, 8, 7,6,5,4,3,2,1}; int size = 9; // odd for (int i = size; i >= 0; i--) { if (arr[i] % 2 != 0) { std::cout << arr[i] << " "; } } std::cout << endl; // even for (int i = size -1; i > 0; i--) { if (arr[i] % 2 == 0) { std::cout << arr[i] << " "; } } return 0; }