Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ PLEASE in the code given below Problem statement Assume the user inputs an array of 10 integer numbers in the following format: 0

IN C++ PLEASE in the code given below

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:

1 2 3 4 5 6 7 8 9 10 

Output:

1 3 6 10 15 21 28 36 45 55 

#include

#define N 10

int main() {

// ---------------- DO NOT MODIFY THIS ----------------

int input[N]; // input read from the user

for (int i = 0; i < N; ++i)

scanf("%d", &input[i]);

// -----------------------------------------------------

// YOUR CODE GOES HERE//

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

i need 6 5 7 .

Answered: 1 week ago