1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leviafan [203]
3 years ago
12

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.
Mathematics
1 answer:
jeka943 years ago
4 0
int scores[] = { 10, 20, 30, 40 };
int nrElements = sizeof(scores) / sizeof(scores[0]);

for (int i = 0; i <nrElements - 1; i++)
{
   scores[i] += scores[i + 1];
}

You might be interested in
Kai has $40 to spend on groceries.He buys a ham for $14 and then wants to pick up apples for $2.50 per pound. How many pounds of
BabaBlast [244]
10.4 pounds of apples
5 0
4 years ago
Read 2 more answers
Please someone do this for me
ss7ja [257]

Answer:

A = -12

Step-by-step explanation:

A   put in -2 for 'x' in the equation to find value

       2(-2)  - y = 8       add 4 to both sides

              -y = 12

               y = -12              

        I think YOU can now find B and C  with this method !

3 0
2 years ago
Read 2 more answers
Write an algebraic expressions for 11 fewer than a number f ?
meriva
F-11 because its 11 fewer than f which means you subtract 11 from f
6 0
3 years ago
Show how to make a ten to solve 3 - 7
Marta_Voda [28]
The 3 is a positive integer and the 7 is a negative integer so you would do "KFC" also known as (Keep, Flip, and Change)

3
("Keep" the 3 positive)
-
("Flip"the minus sign into a plus sign)

-7
("Change" the negative sign into a positive sign)

So therefore, you would have:

3 + 7, which equals 10
3 0
4 years ago
Help pls it’s the last day of summer school
Lyrx [107]
2 1/3 and it is the same for me lol
4 0
3 years ago
Other questions:
  • 6) Ms. Shaver is making some cookies. For each cup of flour, she needs 1/8 cups of water. If
    5·1 answer
  • Help me solve this problem. quick !!!<br> thank you!!!!!
    6·2 answers
  • Don’t know how to solve third problem help!!!!
    13·1 answer
  • One day in October 2005, you could exchange $3 for about 2.5 euros. How many dollars would you have needed to get 8 euros?
    14·1 answer
  • Mathamatical expreshion containing one or more varables
    14·1 answer
  • How many kilometers are equal to one light year
    5·2 answers
  • What is 0.0000000405 in standard notation
    8·2 answers
  • Select the table that represents a linear function.
    9·1 answer
  • The height of a triangle is 7 cm and the height of a similar triangle is 21 cm. How much larger is the
    13·1 answer
  • Pork chops cost $1.39 per pound.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!