Question: In this program you need to find the total sum of the numbers which are even in the list. To implement this question, firstly get
In this program you need to find the total sum of the numbers which are even in the list. To implement this question, firstly get n from the usern is the total number of the items in the list. After getting n value from the user, you can generate 2 random numbers for the starting and ending point of the range of the numbers. Finally, write a function that returns the total sum of the values that are even. The prototype of the function is findTotalsumistart, end); int You can see the example in the sample output. Do not forget that numbers must be random. Sample Output: Enter the number of items: 5 #This number is a user input which shows the total number of the elements of the list. Random numbers Start: 15 #starting point end: 150 Nending point #After getting n and generating the limits (start and end, call the function findTotalsum(start, end) #This function generates nitems between start and end points. You can see 5 random numbers between 15 and 150/NUMBERS ARE EXAMPLE! YOUR NUMBERS MUST BE RANDOM NUMBERS!) List -- 20, 120, 15,60,35 Generaten (5) numbers, then show all of them on the console. Total Sum -- 200 #Show the total sum of the values which are even
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
