for the given code
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
void swap(int *xp, int *yp)
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
void selectionSort(int arr[], int n)
{
int i, j, min_idx;
for (i = 0; i < n-1; i++)
{
min_idx = i;
for (j = i+1; j < n; j++)
if (abs(arr[j]) < abs(arr[min_idx]))
min_idx = j;
if (abs(arr[j]) == abs(arr[min_idx])){
if (arr[j] < arr[min_idx])
min_idx = j;
}
swap(&arr[min_idx], &arr[i]);
}
}
int main()
{
int N;
scanf("%d", &N);
int i,t;
int T[N];
for(i=0;i<N;i++){
scanf("%d",&T[i]);
}
selectionSort(T, N);
for(i=0;i<N;i++)
{printf("%d\n",T[i]);}
if(T==NULL)
{
printf("0\n");
}
return 0;}
positive values are printed before negative values what should I do to get an output {1,2,-2,3-5,6,-7,11,-21,33} for input 10 {-21,2,11,3,-7,-2,33,-2,6,1} code URL https://ide.geeksforgeeks.org/dbGpvPBuV1