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
using namespace std;
int main() {
int n = 5;
vector
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
Get step-by-step solutions from verified subject matter experts
