Question: Using C Language Compile both programs with Wall. Wall shows the warnings by the compiler. Be sure it compiles on student cluster with no errors

 Using C Language Compile both programs with Wall. Wall shows the

Using C Language

Compile both programs with Wall. Wall shows the warnings by the compiler. Be sure it compiles on student cluster with no errors and no warnings.

gcc Wall arrays1.c

gcc Wall arrays2.c

2. (50 points) Write a program that adds the first and last elements of an integer array and stored as the first element of the output array, adds the second and second-to-last elements and stored as the second number, and so on. If the array has an odd number of integers, leave the central integer in the original array unchanged. Sample input/output #1: Enter the length of the array: 7 Enter the elements of the array: 3 5 8 4 1 39 Output: 128 94 Sample input/output #2: Enter the length of the array: 6 Enter the elements of the array: 2 6 13 4 1 7 Output: 9 7 17 1) Name your program arrays2.c 2) Include the following function compute() in the program: void compute(int *al, int ni, int *a2, int n2); al represents the input array with length nl, and a 2 represents the output array with length n2. The function should use pointer arithmetic-not subscripting-to visit array elements. In other words, eliminate the loop index variables and all use of the I operator in the function. 3) In the main function, ask the user to enter the length of the input array, declare the input array, calculate the length of the output array, declare the output array, call the compute function, and display the output array. Before you submit 1. Compile both programs with Wall. -Wall shows the warnings by the compiler. Be sure it compiles on student cluster with no errors and no warnings. gcc-Wall arraysl.c gcc-Wall arrays2.c

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!