halo all,
i've made a program that reverses the input string.but the output is not coming right.here's my code.
suppose i input "when"Code:#include<stdio.h> #include<conio.h> #include<string.h> int main(void) { char s[100]; gets(s); int i; int len=strlen(s); for(i=0;s[i]!='\0';i++) s[i]=s[--len]; puts(s); getch(); return 0; }
the output comes out to be "neen" i.e it doesn't reverses the whole string.
Thanks



LinkBack URL
About LinkBacks


