#include <stdio.h>
int main() {
char str[100];
char ch;
printf("Enter a string: ");
fgets(str, sizeof(str), stdin);
printf("Enter the character to find: ");
scanf(" %c", &ch);
int found = 0;
for (int i = 0; str[i] != '\0'; i++) {
if (str[i] == ch) {
found = 1;
printf("Character '%c' found at index %d\n", ch, i);
break;
}
}
if (!found) {
printf("Character '%c' not found in the string\n", ch);
}
return 0;
}