C Programming Code Examples C > Arrays and Matrices Code Examples Split an Array from Specified Position & Add First Part to the End Split an Array from Specified Position & Add First Part to the End This C Program splits an array from specified position & add first part to the end. This program first accepts an array. Then splits an array according to the user specification. Now it becomes 2 parts & then add first part of an array at the end of a second part. /* C program to read an array, accept a key & split the array. Add the first half to the end of second half. */ #include <stdio.h> void main () { int number[50]; int x, n, a, j; printf("Enter the value of n\n"); scanf("%d", &n); printf("enter the numbers\n"); for (x = 0; x < n; ++x) scanf("%d", &number[x]); printf("Enter the position of the element to split the array \n"); scanf("%d", &a); for (x = 0; x < a; ++x) { number[n] = number[0]; for (j = 0; j < n; ++j) { number[j] = number[j + 1]; } } printf("The resultant array is\n"); for (x = 0; x < n; ++x) { printf("%d\n", number[x]); } }