Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int a[100], b[100], i, n, j=0;
- scanf("%d", &n);
- for(i=0; i<n; i++)
- scanf("%d", &a[i]);
- for(i=0; i<n; i++){
- if(a[i]%2==0){
- b[j]=a[i];
- j++;
- }
- }
- for(i=0; i<n; i++){
- if(a[i]%2!=0){
- b[j]=a[i];
- j++;
- }
- }
- for(i=0; i<j; i++)
- printf("%d ", b[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement