Hello. I am new to C and I can't figure out why I am getting segmentation fault when I run this code:
Thanks in advance.Code:/* prints a word backword */ #include<stdio.h> #include<string.h> int main(void) { int i; char word[40]; printf("Please enter a word to be printed backword: "); scanf("%s", word); for (i = strlen(word); i >= 0; i--) // for loop printf("The word %s backword is %s\n", word, word[i]); return 0; }