Just started programming, please help me:)

j+e's Avatar, Join Date: Feb 2009
j+e
Light Poster
Hi! I have just started programming and I have a question for my assignment:

When the input is ABCDE, i want the Output to be EDCBA, but for some reason I cannot understand, the output i get is: EDCDE

I have written the following in my program:

for (int i = 0; i < b; i=i++)
{
char temp1 = a[i];
a[i] = a[(b-1)-i];
a[(b-1)-i] = temp1;
cout << a[i] ;

Can somebody please help me?

Thanks!
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Duplicate of Please help me. Thread closed. Please do not create the same thread over and over again.