NAME:RAMKRISHNA ARUTLAWAR printf("String not found.
\n");
BRANCH:IF3K PRAC:3 }
#include <stdio.h> return 0;
#include <string.h> }
#define MAX_STRINGS 100 OUTPUT:
#define MAX_LENGTH 100
int linearSearch(char arr[][MAX_LENGTH], int n,
const char* target) {
for (int i = 0; i < n; i++) {
if (strcmp(arr[i], target) == 0) {
return i;
}}
return -1;
int main() {
char strings[MAX_STRINGS][MAX_LENGTH];
int n;
char target[MAX_LENGTH];
printf("Enter the number of strings: ");
scanf("%d", &n);
printf("Enter the strings:\n");
for (int i = 0; i < n; i++) {
scanf(" %[^\n]", strings[i]); }
printf("Enter the string to search for: ");
scanf(" %[^\n]", target);
int index = linearSearch(strings, n, target);
if (index != -1) {
printf("String found at index %d.\n", index);
} else {