🟢 Վարժություն 11
Ի՞նչ կպտվի էկրանին։
#include <iostream>
int main() {
int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int* p = arr;
for (int i = 0; i < 10; i+=2) {
std::cout << *(p+i) << " ";
}
}
#include <iostream>
int main() {
int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int* p = arr;
for (int i = 0; i < 10; i+=2) {
std::cout << *(p+i) << " ";
}
}