int main ()
{
int i;
char a[100],c,flag=0;
printf("Enter a string: ");
gets(a);
printf("Enter a character to find: ");
scanf("%c",&c);
for(i=0;i<a[i];i++)
{
if(a[i]==c)
{
flag=1;
break;
}
}
if(flag==1)
printf("FOUND\n");
else
printf("NOT FOUND\n");
return 0;
}
No comments:
Post a Comment