Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming in C Calculate the sum of a series of integer numbers. The code must: 1. Construct a simple menu in main) that gives the

image text in transcribed

Programming in C Calculate the sum of a series of integer numbers. The code must: 1. Construct a simple menu in main) that gives the user the option to perform: the sum of a series of odd integer numbers. .the sum of a series of even integer numbers. 2. In main), generate an integer array with NMAX elements, and call it "inums". Initialize all of its elements to zero. In this particular case, set NMAX-100, but keep your code as flexible as possible. 3. From main() call a function called "create_array" and: pass to the function the address of the array "inums" (and anything else you may need) inside the function, store in the array the first NMAX odd/even numbers as a function of the choice made in question 1 4. Back in main(), ask the user how many of those numbers will be added, and call this number "nsum" 5. From main(), call a function called "add_function" and: pass to the function the address of the array "inums" (and anything else you may need) . inside the function, perform the sum of the first "nsum" even/odd integer numbers stored in the array "inums" inside the function, return the value of the sum to main() 6. Show that your program works by: testing your sanity checks with a collection of incorrect inputs performing the sum of the first 10 odd integer numbers, and showing that the solution agrees with the analytical solution performing the sum of the first 10 even integers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions