Answer:
There is only one modification in the above loop i.e. while loop should be like this--
while (i != n)
{
sum+=arr[i]; // Line 1, In question segment it is line 2.
i++; // Line 2, In question segment it is line 1.
}
Output:
Now if the array input is 1,2,3,4,5 then the output is 15.
Explanation:
In the above question, all the line of the segment is right except the body of the loop because--
- The First line of the loop is increment statement which increments the value of "i" variable from 1 and the value of "i" variable will be 1 in the first iteration of the loop
- The second line starts to add the value from 1'st index position of the array. Hence the segment gives the wrong answer. It adds the arr[1] to arr[n-1].
- So I interchanged both lines of the while loop as shown in the answer part. I make the line 1 (In question segment) as line 2(In answer part) and line 2 (In question segment) as line 1 (In answer part).
Now It gives the correct output because it can add arr[0] to arr[n-1].
Answer:
current of electricity
Explanation:
hope it will help full to you
<span>The answer is Ten. Substituting numbers for letters, available selections are 111, 112, 113, 122, 123, 133, 222, 223, 233, 333. Note that, for example, 112, 121, and 211 are considered as the same selection.
</span>AAA, BBB, CCC, <span>AAB, AAC, </span><span>BBC, </span><span>ABB, ACC, </span><span>CCB & ABC.</span>
By learning how to follow, one can be a good leader because: Looking up to a leader and following them help to:
- Keep one's ego in check and one can be able to be a good ego manager.
- They create strong credibility.
- They help use to focus our efforts for maximum impact.
<h3>How does being a good follower make you a good leader?</h3>
As a good follower, a person can be able to have the boldness and confidence to be able to respectfully talk about a lot of things with their leader if you see that you're not going in the right way.
Note that one can trust your leader and this will boast up the spirit of your input and engagement in all.
Hence, By learning how to follow, one can be a good leader because: Looking up to a leader and following them help to:
- Keep one's ego in check and one can be able to be a good ego manager.
- They create strong credibility.
- They help use to focus our efforts for maximum impact.
Learn more about good leader from
brainly.com/question/12522775
#SPJ1