What will be the output of the following code?
#include <iostream> using namespace std; void modifyArray(int arr[], int size) { for(int i = 0; i < size; i++) { arr[i] += 5; } } int main() { int arr[3] = {1, 2, 3}; modifyArray(arr, 3); for(int i = 0; i < 3; i++) { cout << arr[i] << " "; } return 0; }
1 2 3
6 7 8
1 7 3
Compilation error
This question is part of this quiz :
Quiz on C++ Arrays