So I almost got this program to work but i can seem to figure out the last part. I have to ask the user to input a string and then return the string in reverse. It has to be two functions, the main one asking user for input and then invoking the second function which reverses it. This is my code so far, help please.
#include <stdio.h>
int main(void){
char s[]="test string";
int b ,e,t;
e=strlen(s)-1;// its -1 since s[e] points to the terminating 0
for(b=0;b<e;b++,e--){
t=s[b];
s[b]=s[e];
s[e]=t;
}
printf("%s\n",s);
return 0;
}