Whats wrong? I have to output for eg. if input is Hello World the output should be World Hello :     void word_swap(char *arr){
    
    int tmp1[10], tmp2[10], j = 0, k = 0, a, b, z,i; // must use pointers
    
    for (i=0; i<MAX; i++)
    {
        if(arr[i] == ' ')  //if there's a space, store the characters before the space to another array and after the space to another
        {
            for(j = 0; j<i; j++) // tmp1
                tmp1[j] = arr[j];
        
            for( j = 0; j<MAX-i; j++) //MAX - i would be range of j
                for(k = i+1; k<MAX; k++) //tmp2
                    tmp2[j] = arr[k];
        }
    }
        i = 0;
        while(1)
        {
            while(tmp2[i] != '\0' && i<sizeof(tmp2))  // finding the size of tmp2
                a++;
        }
        for(j=0; j<a; j++) // overwriting the original array
            arr[j] = tmp2[j];
    j++; // incrementing j so that there would be a space between the new array
    z = j; 
    i=0;

        while(1) //finding the size of tmp1
        {
            while(tmp1[i] != '\0' && i<sizeof(tmp1))
                b++;
        }
        //idk pls help
        for( z=0 ; z<MAX; z++) //overwriting the original array
            for(k = 0; k<b; k++)
                arr[z] = tmp1[k];
            //idk pls help

    for (i = 0; i < MAX; i++) // outputting the required result
        printf("%c", *(arr+i));
    printf("\n");}//eg if input is Hello World   the output should be World Hello//idk pls help

so basically I have Hello World output should be World Hello
another example is Cats Kitten out is Kitten Cats
must use pointers. the main function passes the function as word_swap(word1) where word1 is char word1[] = {'h','e', etc)