void reverse(int* arr,int sz)
{
int right = sz - 1;
int left = 0;
while (left < right)
{
while (left < right && arr[left] % 2 == 1)
{
left++;
}
while (left < right && arr[right] % 2 == 0)
{
right--;
}
if(left<right)
{
int tmp = arr[left];
arr[left] = arr[right];
arr[right] = tmp;
right--;
}
}
}
int main()
{
int arr[] = { 1,2,3,4,5,6,7,8,10,20,15,55,64,54};
int sz = sizeof(arr) / sizeof(arr[0]);
reverse(arr,sz);
int i = 0;
for (i = 0; i < sz; i++)
{
printf("%d ", arr[i]);
}
return 0;
}