Complete the code to remove the first element from the array by shifting elements left.
for (int i = 0; i < n - 1; i++) { arr[i] = arr[[1]]; } n--;
To delete the first element, each element shifts left by copying the next element at index i+1 to index i.
Complete the code to print the array after deleting the first element.
for (int i = 0; i < n; i++) { std::cout << arr[[1]] << " "; } std::cout << std::endl;
After deletion, print elements from index 0 to n-1.
Fix the error in the code that deletes the first element by shifting elements.
for (int i = 0; i < n - 1; i++) { arr[i] = arr[[1]]; } n--;
The loop should run till n-1 and assign arr[i] = arr[i+1] to shift elements left.
Fill both blanks to delete the first element and print the updated array.
for (int i = 0; i < n - 1; i++) { arr[i] = arr[[1]]; } n[2]; for (int i = 0; i < n; i++) { std::cout << arr[i] << " "; }
Shift elements left by assigning arr[i] = arr[i+1], then decrease n by one using --.
Fill the blanks to delete the first element, reduce size, and print the updated array.
for (int i = 0; i < n - 1; i++) { arr[[1]] = arr[i + 1]; } n[2]; for (int i = 0; i < n; i++) { std::cout << arr[i] << " "; }
Assign arr[i] = arr[i+1], decrease n by --, and print the updated array.
