int main() { int n; cout << "Enter the number of elements in the array: "; cin >> n;
int A[n]; cout << "Enter elements of the array:\n"; for (int i = 0; i < n; i++) { cin >> A[i]; } cout << "Elements with odd ordinal numbers:\n"; for (int i = 0; i < n; i++) { if (i % 2 != 0) { cout << A[i] << endl; } } return 0;
using namespace std;
int main() {
int A[n];int n;
cout << "Enter the number of elements in the array: ";
cin >> n;
cout << "Enter elements of the array:\n";
for (int i = 0; i < n; i++) {
cin >> A[i];
}
cout << "Elements with odd ordinal numbers:\n";
for (int i = 0; i < n; i++) {
if (i % 2 != 0) {
cout << A[i] << endl;
}
}
return 0;
}