Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //Your function called MultiplyByIndex goes here
- void DoAddyStuff(int array_input[], int arraySize)
- {
- std::cout << array_input[0] << ", ";
- for (int i = 1; i < arraySize; i++)
- {
- array_input[i] = array_input[i] + array_input[(i - 1)];
- std::cout << array_input[i] << ", ";
- }
- }
- int main()
- {
- int integer_array[4] = { 3, 2, 4, 7 };
- DoAddyStuff(integer_array, 4);
- std::cout << std::endl;
- DoAddyStuff(integer_array, 4);
- std::cout << std::endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment