Thank you very much! That helped, because I found out that the letters where shuffled to EDCBA, and then shuffled back to ABCDE. So I just said that: for (int i = 0; i < (b-((b+1)/2)); i++) because odd number/2 will be rounded down, this works! Maybe not the best way to do it in a programmers view, but it worked
> Maybe not the best way On the contrary, reversing a string by only looping over the first half, rounded down, is very efficient. Just to make sure though, try a even number length string, e.g. ABCDEFGH, make sure you get the correct output.
I have tried that, and it works out perfectly well. Even though setences!! :happy: Again, thanks for your help!
The code you guys entered is not correct,,, cause you have to reverse it along with its place,,, here this may be helpful #include<iostream.h> #include<conio.h> using namespace std; main() { cout<<"Enter The Number Alphabets your Word has \t"; int x; cin>>x; cout<<"Enter Your Word:"; char a[x]; cin>>a; char temp; for (int i=x; i>=0;i--) { temp=a; a=temp; cout<<a; } cout<<endl; getch(); }