The program is as follows:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
    setbuf(stdout,NULL);
    int l,i;
    char s[10],c;
    printf("Enter the string: ");
    gets(s);
    l=strlen(s);
    for(i=0;i<l/2;i++){
        c=s[i];
        s[i]=s[l-1-i];
        s[l-1-i]=c;
    }
    printf("The reversed string is: %s ",s);
    return EXIT_SUCCESS;
}
The output is: Enter the string: hello world. The reversed string is: hlrow olleo.
 
     
     
    