C Exercises: Create a new array containing the middle elements from the two given arrays of integers, each length 5
39. Extract Middle Elements from Two Arrays
Write a C program to create a new array containing the middle elements from the two given arrays of integers, each of length 5.
C Code:
Sample Output:
Elements in original array are: 10, 20, -30, -40, 30 10, 20, 30, 40, 30 Elements in new array are: -30, 30
Pictorial Presentation:
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C program to merge the middle two elements from two arrays of even length.
- Write a C program to create a new array from the middle three elements of an odd-length array.
- Write a C program to extract and swap the middle elements of two arrays of equal length.
- Write a C program to combine the middle element of one array with the first element of another.
C Programming Code Editor:
Previous: Write a C program to reverse a given array of integers and length 5.
Next: Write a C program to create a new array taking the first and last elements of a given array of integers and length 1 or more.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.