There is an array a[9] . Made such an implementation of filling the array with only odd numbers starting from 1. It seems a bit clumsy, have ideas how you can implement a more rational way?
#include <iostream> using namespace std; int main() { const int SIZE = 9; int a[SIZE]; int i = 0; int j = 0; while (j < SIZE) { if (i % 2 != 0) { a[j] = i; j++; } i++; } for (int i = 0; i < SIZE; i++) { cout << a[i] << " "; } system("pause"); } 
int a[] = {1, 3, 5, 7, 9, 11, 13, 15, 17};:) - αλεχολυτn, I think, it is quite suitable. - αλεχολυτ