Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int size = 4;
- int list[4] = {12,3,7,8};
- int temp;
- cout<<endl;
- int Evens = 0;
- for (int i = 0; i < size; i++){
- if (list[i] % 2 == 0){
- temp = list[i];
- for (int j = i; j > Evens; j--){
- list[j] = list[j - 1];}
- list[Evens] = temp;
- Evens++;
- cout<<list[i];
- }
- }
- for(int i = 0; i < size; i++){
- cout<<list[i];
- cout<<" | ";
- }
- return 0;
Add Comment
Please, Sign In to add comment