74. C Program To Separate 5 Elements for each phase from the given Array Elements.
How does this program work?
- This Program is used to Separate 5 Elements For Each phase from the given array elements using C program.
Here is the code
# include <stdio.h>
int main(void )
{
int a[30], b[30], n,i, j, temp;
printf(" Enter the terms : \n");
for(i=1;i<=10;i++ )
{
scanf("%d ",& a[i]);
b[i] = a[i];
}
printf("\nTotal Elements are: \n") ;
for(i=1; i<=10; i++)
printf(" %d \t",b[i]) ;
printf("\nfirst phase Elements are: \n" ) ;
//keep last 5 elements in the first phase
for (i=6; i<=10; i++)
printf(" %d \t",b[i]) ;
printf("\nLase phase Elements are: \n" ) ;
//keep first 5 elements in the Last phase
for (i=1; i<=5; i++)
printf(" %d \t",b[i]) ;
return 0;
}