We start with an array of size 5 containing elements 10, 20, 30, 40, 50. First, we check if the array is empty by verifying if size is greater than zero. Since size is 5, we proceed to delete the last element by reducing the size to 4. The array data remains unchanged, but logically the last element is removed by ignoring it beyond the new size. If the array was empty (size 0), deletion would stop immediately to avoid errors. This method efficiently deletes the last element by adjusting size without shifting or erasing data.