My code for rotating arrays gives error for large array size(around 50) help me? : **Problem**: I was trying to solve this problem from geeksforgeeks on array rotation
code seems to be working fine for small array size but for large array size it displays some garbage values and then stops working.

The question is on this link: https://practice.geeksforgeeks.org/problems/rotate-and-delete/0

and my code is:
    
    # include<iostream>

    using namespace std;

    void rotate_clockwise(int *arr, int size)
    {
	    int temp = *(arr + size -1);
	    for(int i = 0;i < size;++i )
	    {
		    *(arr +(size -1) - i) = *(arr + (size-1) -(i+1));//*(arr +(size -1)) 
	    }
	    *arr = temp;
    }

    void initialize_array(int *arr,int size)
    {
	
	   for(int  i ; i < size; ++i)
	   {
		    cin>>*(arr +i);
	   }
	
	
    }

    void print_array(int *arr,int size)
    {
	    for(int i = 0; i< size; i++)
	    {
		    cout<<*(arr + i)<<" ";
	    }
	    cout<<endl;
    }

    void remove_ith_fend(int i, int *arr, int *ptr_size)
    {	
	    int size = *ptr_size;
	
	    int *last = (arr + size -1);
	
	    i = i-1;
	
	    if(i < size)
	    {
		    for(int j =0 ;j<size;j++)
		    {
			    *(last - i + j) = *(last -i + j+1);
		    }
	    }
	    else
	    {
		    for(int j = 0;j<size;++j)
		    {
			    *(arr + j) = *(arr + j +1);
		    }
	    }
	    --size;
	    *ptr_size = size;
        }

    int main()
    {
	    int size;
	
	    cout<<"Enter size of array: ";
	
	    cin>>size;
	    int *ptr_size;
	    ptr_size = &size;
	
	    int arr[size];
	
	    initialize_array(arr, size);
	
	    print_array(arr, size);
	
	    for(int i =1;size!=1;++i)
	    {
		    cout<<"rotating"<<endl;
		
		    rotate_clockwise(arr,size);
	
		    print_array(arr,size);
			
		    remove_ith_fend(i, arr, ptr_size);
		
		    cout<<"removing "<<i<<"th element from the end"<<endl;
	
		    print_array(arr,size);
	    }
	
	    return 0;
    } 

I was only trying this out so I don't take input for test cases which they are giving in the question.
Sorry I have not commented the code but I was in the process of solving this and 
was going to do it later after getting the solution right.

Here is the error I was getting when I entered the array size: 54

    Enter size of array: 54
    4741824 0 -1 0 4744768 0 4503683 0 1 0 4745728 0 8 0 4751362 0 4744784 0 
    7339432 0 7339436 0 1 0 0 0 -1 0 4741824 0 -1 0 4741824 0 10 0 4254288 
    16777216 0 54 8390488 0 224 0 -1 0 4200452 0 0 0 0 0 8 0
    rotating
    0 4741824 0 -1 0 4744768 0 4503683 0 1 0 4745728 0 8 0 4751362 0 4744784 0 
    7339432 0 7339436 0 1 0 0 0 -1 0 4741824 0 -1 0 4741824 0 10 0 4254288 
    16777216 0 54 8390488 0 224 0 -1 0 4200452 0 0 0 0 0 8
    removing 1th element from the end

It didn't asked for any input and just exited after printing this thing above.
Also please point out some issues that I have with the way code is written as I am new to programming and like to learn the better way of writing.