67 030
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #73336 in C++ for kon

Question #73336
Initialize an integer array of size 10; pass it to a function ‘arrIncrement’ using a pointer. The function should increment all elements of the array by one. Then display the updated array on screen.code plz
Expert's answer
#include <iostream>

using namespace std;

const int SIZE = 10;

void arrIncrement(int* arr){
for(int i = 0; i < SIZE; ++i){
arr[i]++;
}
for(int i = 0; i < SIZE; ++i){
cout << arr[i] << " ";
}
cout << endl;
}

int main(){

int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
arrIncrement(arr);

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions