Write a Program in C language, algorithm and draw flowchart to find whether a given string S1 is substring of another string S2
#include
#include
void main()
{
char S1[25],S2[25];
char *sub;
printf("Enter string S2: ");
gets(S2);
printf("Enter string S1 : ");
gets(S1);
sub=strstr(S2,S1);
if(sub==0)
printf("not substring");
else
printf("%s - substring of ->%s",S1,S2);
}
#include
void main()
{
char S1[25],S2[25];
char *sub;
printf("Enter string S2: ");
gets(S2);
printf("Enter string S1 : ");
gets(S1);
sub=strstr(S2,S1);
if(sub==0)
printf("not substring");
else
printf("%s - substring of ->%s",S1,S2);
}
Hi there, all the time i used to check website posts here early in
ReplyDeletethe dawn, since i like to learn more and more.
my webpage: equity home loan refinancing vs