Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

13.18 Arrays - Ex2 Problem statement Assume the user inputs an array of 10 integ

ID: 3722986 • Letter: 1

Question

13.18 Arrays - Ex2 Problem statement Assume the user inputs an array of 10 integer numbers in the following format 0 10 11 20 12 124 12 44 10 This array will be already initialized in the template code provided to you so you don't have to code this Your task Create a second integer array in your code named output Afterwards, have your program set the elements of the second array to the cumulative totals of the elements of the first array. For example the fourth element of the second array should equal the sum of the first four elements of the first array, and the fifth element of the second array should equal the sum of the first five elements of the first array Requirements . You must print every element of the output array separated by a space. Do NOT print a space after the last number Example 1: Input 4 5678910 Output 1 3 6 10 15 21 28 36 45 55 13.18.1: Arrays- Ex2 0/16 ACTIVITY main.c Load default template... 3 int sain)

Explanation / Answer

#include <stdio.h>
#include <conio.h>
int main()
{
int input[10];
int N=10;
int outPut[10];
printf("Please enter 10 no");
for (int i = 0; i < N; i++)
{ scanf("%d", &input[i]); }

for (int i = 0; i < N; i++)
{
outPut[i]=0; // initialised with zero so that it does not take a garbage value
for(int j=0;j<=i;j++){
outPut[i]+=input[j];
}
printf("%d",outPut[i]);

if(i!=N-1){
printf("%s"," ");
}
}
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote