Problem #1 - Initializing and summing an array using for loops Write a program which creates a one dimensional, array of int type with 10 elements. Name the array "data[]". Initialize the array using a for loop such that each element is its index number plus 10. For example, data[0] will be a value of 10, data[1] will be 11, etc. Print out all the elements of the array using two columns. The first column is the index and the second column is the value of the element. After printing out the index and values, print out the sum of all the elements of the array. Use a for loop to sum all the elements. Make the output look like this screen shot. Name the file "array_sum.c" Index Value 10 11 12 13 14 15 16 17 18 19 Sum 145
Problem #1 - Initializing and summing an array using for loops Write a program which creates a one dimensional, array of int type with 10 elements. Name the array "data[]". Initialize the array using a for loop such that each element is its index number plus 10. For example, data[0] will be a value of 10, data[1] will be 11, etc. Print out all the elements of the array using two columns. The first column is the index and the second column is the value of the element. After printing out the index and values, print out the sum of all the elements of the array. Use a for loop to sum all the elements. Make the output look like this screen shot. Name the file "array_sum.c" Index Value 10 11 12 13 14 15 16 17 18 19 Sum 145
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.1: One-dimensional Arrays
Problem 10E: (Electrical eng.) Write a program that specifies three one-dimensional arrays named current,...
Related questions
Question
100%
- Needs to be written in C
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage