Programming 01

🟢 Վարժություն 15

Ի՞նչ կտպվի էկրանին։
#include<iostream>
void foo(int *a, const int size) {
  for (int i = 0; i < size; ++i) {
     *(a+i) = 0;
  }
}

int main() {
   constexpr int N = 5;
   int arr[N] = {1, 2, 3, 4, 5};
   foo(arr, N);
   for (int i = 0; i < N; i+=1) {
     std::cout << arr[i] << " ";
   }
}
 
To check your solution you need to sign in
Sign in to continue