Given a string and a sub-string, check whether the sub-string is present in the string using library function
Implementation:
Implementation:
#include <stdio.h> #include<string.h> #include<stdlib.h> int main(void) { char *m,*s; const char *p; m=(char*)malloc(sizeof(char)); s=(char*)malloc(sizeof(char)); scanf("%s",m); scanf("%s",s); p=strstr(m,s); if(p!=NULL) printf("Substring found"); else printf("Substring not found"); return 0; }