While reversing the user's inputted string...This code won't work properly.Why?In C programming. Please take time to view code..
I divide this code into two sections.... ------------------------------------------------------------------------------------------------------------ First section (OUTPUT-1): In this section,I tend to reverse the users inputted string.... In this process, i initialise the Reversed string character in (char array) i.e char c[100] one by one... And after that process,I output that initialised characters one by one Eg: printf("%c",c[0]); printf("%c",c[1]); printf("%c",c[2]); .... etc It's output also work very well.... --------------------------------------------------------------------- --------------------------------------------------------------------- Second section (OUTPUT - 2); In this section,I tend to output that whole reversed string....Which is stored in a char array(i.e char c[100]) Like this printf("%s",c); But, while doing this process.I found unexpected output in second section (OUTPUT - 2) and also OUTPUT - 1 != OUTPUT - 2 https://code.sololearn.com/cTtpn9bz6HLg/?ref=app