Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Specifer



" ; " after loop



Header file



Comment



Test expression




String_ CMP - strstr function




// AHF C PROGRAM SOLVING

//solving here CHARACTER MANIPULATION FUNCTION ( CMP ) 	programming problem

#include<stdio.h> #include<string.h> #define pf printf int main() { char str1[100],str2[100],ptr; //input first string data pf("Enter the first string: "); gets(str1); //input substring data pf("\nEnter the second string: "); gets(str2); //find substring ptr=strstr(str1,str2); if(ptr) pf("\nSubstring is found."); else pf("\nSubstring is not found."); return 0; }
OUTPUT:


© 2018 - All rights reserved