Question: This code shift the letters over one spot and takes the last letter and bring it to the front. Now how can I change this

This code shift the letters over one spot and takes the last letter and bring it to the front.

Now how can I change this to bring the front letter to the back and shift the other letters over to the left by one?????

#include #include #include #include #include #include #include

using namespace std;

int main() {

int n = 5;

vector > array(n, vector(n));//declaring the vector named arrya of type char

int i;

//adding the value in the vecotr array

array[0][0] = 'A';

array[0][1] = 'B';

array[0][2] = 'C';

array[0][3] = 'D';

array[0][4] = 'F';

//printing the vector value before shift

cout<<"Before shifting the char vector is: "<

for(i=0;i

cout<

for (int i=1; i

for (int j=1; j

cout << "array[" << i << "] : ";

for (int j=0; j

cout << endl;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!