Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //Your function called MultiplyByIndex goes here
- void MultiplyByIndex(int inputArray[], int otherInputArray[], int arraySize)
- {
- for (int i = 0; i < arraySize; i++)
- {
- otherInputArray[i] = inputArray[i] * i;
- std::cout << otherInputArray[i] << ", ";
- }
- }
- int main()
- {
- int integer_array[7] = { 10, 15, 7, 4, 13, 19, 8 };
- int output_array[7] = {};
- MultiplyByIndex(integer_array, output_array, 7);
- //output_array should be {0, 15, 14, 12, 52, 95, 48};
- std::cout << std::endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment