Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a[20],b[10],c[10],j=-1,k=-1,i=0,m;
- printf("Input the maximum size of array:");
- scanf("%d",&m);
- printf("Input the array:\n");
- for(i=0;i<m;i++)
- scanf("%d\n",&a[i]);
- if(m<0)
- printf("split is not possible.");
- else
- {
- A:
- if(a[i]%3==0)
- {
- j=j+1;
- b[j]=a[i];
- i++;
- }
- else
- {
- k=k+1;
- c[k]=a[i];
- i++;
- }
- {
- if(i<m)
- goto A;
- else
- printf("\nAfter spliting the array as divide by three:\n");
- for(i=0;i<=j;i++)
- printf("%d\n",b[i]);
- printf("And");
- for(i=0;i<=k;i++)
- printf("%d\n",c[i]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement