Rotation of string

//rotate strings
#include
#include
using namespace std;
int main()
{ int j,i;
char s[10],temp;
cout<<“enter string”;
cin>>s;
j=strlen(s);

for(i=0;i<strlen(s)/2;i++)
{
temp = s[i];
s[i]=s[j];
s[j]=temp;
}
cout<<s;

}

hey @vanshu21, explain me the problem you facing.

the output is not visible

hey @vanshu21, run a loop like that
for(int i=0;i<strlen(s);i++)
{
cout<<s[i];
}

but as its a string , so wont it display the entire word with just writting cout . why to use a loop .

hey @vanshu21, it is not giving any output because j=strlen(s), and at s[j] null character is stored. Inside the for loop that null character comes to s[0] due to s[i]=s[j];.
Now cout prints until it finds null character, and it finds null character at very first index of char array and giving NULL output.
I updated your code here https://ide.codingblocks.com/s/108239.