#include <stdio.h>
#include <string.h>
int isWordPresent(const char array, const char word) {
int lenArray = strlen(array);
int lenWord = strlen(word);
for (int i = 0; i <= lenArray - lenWord; ++i) {
int j;
for (j = 0; j < lenWord; ++j) {
if (array[i + j] != word[j]) {
break;
}
}
if (j == lenWord) {
return 1; // Word found
}
}
return 0; // Word not found
}
int main() {
char charArray[] = "Hello, World!";
char wordToFind[] = "World";
if (isWordPresent(charArray, wordToFind)) {
printf("Word found in the array.\n");
} else {
printf("Word not found in the array.\n");
}
return 0;
}