subject

Modify array elements using other elements. Write a loop that sets each array element to the sum of itself and the next element, except for the last element which stays the same. Be careful not to index beyond the last element.
Ex: Initial scores: 10, 20, 30, 40
Scores after the loop: 30, 50, 70, 40
The first element is 30 or 10 20, the second element is 50 or 20 30, and the third element is 70 or 30 40. The last element remains the same.
1 include ciostream
2 using namespace std;
3
4 int maino
5 const int SCORES SIZE - 4;
6 int bonus Scores[SCORES SIZE);
7 int i;
8
9 for (i = 0; i 10 cin >> bonus Scores[i];
11 >
12
13 /Your solution goes here
14
15 for (1-; i < SCORES. SIZE; ++) {
16 cout << bonus Scores[1] << " ";
17
18 cout << endl;

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:20, khenalilovespandas
Number of megabytes of ram in a computer. qualitative or quantitative? because
Answers: 3
image
Computers and Technology, 22.06.2019 11:30, kieraweems2034
Communication is the exchange of information. true false
Answers: 2
image
Computers and Technology, 23.06.2019 06:30, QueeeenUknown7437
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, kyleemarie2003
Companies that implement and apply an information system effectively can create
Answers: 1
You know the right answer?
Modify array elements using other elements. Write a loop that sets each array element to the sum o...

Questions in other subjects:

Konu
Physics, 19.03.2021 23:10
Konu
Mathematics, 19.03.2021 23:10
Konu
History, 19.03.2021 23:20