can this small code be improved !!
this code just circularly shifts the given string,
n(=4) is the no. of charactars to be shifted
input: sab ulta ho gya
output: gyasab ulta ho
now, can there any refinements !!!!!!!!
suggestions or changes wd be appreciated.
thanks
Code:
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
char *s="sab ulta ho gya";
cout<<s;
char p;
int n=4,i=0,k=0;
int len;
len=strlen(s);
while(i<n) {
k=0;
p=s[len-1];
while(len-1>0)
{ s[len-1]=s[len-2];
len--;
};
s[k]=p;
i++;
len=strlen(s);
};
cout<<"\n"<<s;
getch();
}