#include
#include
using namespace std;
void rotate(char *a,int k){
int i = strlen(a);
while(i>=0){
a[i+k] = a[i];
i–;
}
i = strlen(a);
int y = i-k;
int s = 0;
while(k<i){
a[s] = a[y];
s++;
y++;
}
a[i-k] = ‘\0’;
}
int main() {
char a[100] = “yellow”;
int k=2;
rotate(a,k);
cout<<a<<endl;
}
it is showing runtime error in rotation of string by k