#include <stdio.h>
void main ()
{
int number[30];
int i,n,a,j;
printf (“Enter the value of n\n”);
scanf (“%d”,&n);
printf (“enter the numbers\n”);
for (i=0; i<n; ++i)
scanf (“%d”, &number[i]);
printf (“Enter the position of the element to split the array \n”);
scanf (“%d”,&a);
for (i=0; i<a; ++i)
{
number[n] = number[0];
for (j=0; j<n; ++j)
{
number[j] = number[j+1];
}
}
printf(“The resultant array is\n”);
for (i=0; i<n; ++i)
{
printf (“%d\n”,number[i]);
}
} /* End of main() */
/*————————————————-
Output
Enter the value of n
5
enter the numbers
30
10
40
50
60
Enter the position of the element to split the array
2
The resultant array is
40
50
60
30
10
———————————————————-*/
Not Satisfied ? Just search & get the result
Related posts:
- C Program to accept N integer number and store them in an array AR. The odd elements in the AR are copied into OAR and other elements are copied into EAR. Display the contents of OAR and EAR
- C program to input N numbers (integers or reals) and store them in an array. Conduct a linear search for a given key number and report success or failure in the form of a suitable message
- C program to accept a list of data items and find the second largest and second smallest elements in it. And also computer the average of both. And search for the average value whether it is present in the array or not. Display appropriate message on successful search.
- C program to read N integers and store them in an array A, and so find the sum of all these elements using pointer. Output the given array and and the computed sum with suitable heading
- C programme to cyclically permute the elements of an array A. i.e. the content of A1 become that of A2.And A2 contains that of A3 & so on as An contains A1
