Question: Question 7 (a) Write a C program called evenread that reads a series of integers as input into an array of integers. evenread should continue

 Question 7 (a) Write a C program called evenread that reads

Question 7 (a) Write a C program called evenread that reads a series of integers as input into an array of integers. evenread should continue reading until the user types -1. You can assume that the user always types at least one integer before typing -1. You can also assume that the user never types more than 20 integers. After reading the integers evenread must print out all of the numbers in the array that are divisible by two. So, for example, a sample run of the program would look like: evenread Enter integers 4 5 6 The even integers are 4 6 [11 marks] (b) Write a C function called lessthan10 with the header: int lessthan10(int source[], int dest[],int len); which iterates through the first len elements of source and copies the el ements that are less than 10 to dest and returns the number of elements copied. Thus, after executing the code: int a[]-13,6,12,9,15}; int b[10]; int c-0; c-lessthan 10 ( a,b, 5) ; the array b will contain 3, 6 and 9 as its first three elements and c will contain the value 3 because three values were copied to b. [7 marks] [Total for Question 7: 18 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!