Skip to content

Conversation

@KUMUDSHANDILYA
Copy link

#include<stdio.h>
#include<string.h>
int main()
{
char str[1000], substr[100];
printf("Enter desired string: ");
gets(str);
printf("Enter substring: ");
gets(substr);
int l1=strlen(str);
int l2=strlen(substr);
int i;
int j=0;
for(i=0;i<=l1-l2;i++)
{
if(str[i]==substr[j];
j++;
}
if(j==l2)
{
printf(\n"True");
}
else
{
printf("\nFalse");
}
return 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant