Question: Please help C++ programming, Add each element in origList with the corresponding value in offsetAmount. Print each sum followed by a space. Ex: If origList
Please help C++ programming,
Add each element in origList with the corresponding value in offsetAmount. Print each sum followed by a space. Ex: If origList = {40, 50, 60, 70} and offsetAmount = {5, 7, 3, 0}, print: 45 57 63 70 #include int main() { const int NUM_VALS = 4; int origList[NUM_VALS]; int offsetAmount[NUM_VALS]; int i = 0; origList[0] = 40; origList[1] = 50; origList[2] = 60; origList[3] = 70; offsetAmount[0] = 5; offsetAmount[1] = 7; offsetAmount[2] = 3; offsetAmount[3] = 0; // your solution goes here
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
