scanf takes a pointer, ans is not a pointer so you need to add the address of operator in front of ans and cover for the lameness of scanf by also reading the newline that it is sure to leave in the input stream:
scanf ( "%c%*c", &ans );
You'll also want to read the newline in just about every case of scanf in your program. Note that arrays don't need the address of operator when using them with scanf because the array name that you use is already a pointer.
Use return to exit the main function. And the use of exit requires that you include stdlib.h.
char ans = '\0';
printf("Please enter a word\n");
pos = strlen(buf) - strlen(".web");
if (0==strcmp(buf + pos, ".web"))
printf("To enter another word type 'Y'\n");
} while (ans=='Y');