Sunday, February 24, 2013

C Language Example # 24 Example : Find string inside a string

C Language Example # 24 Example : Find string inside a string.

* Find character from string.

//Written by Latest Technology Guide    
//Title : C Language Example # 24 Example : Find string inside a string.


#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
clrscr();
char ch[20],find[20],*i;

printf("Enter String 1 : ");
gets(ch);

printf("Enter String to Find :");
gets(find);

if(strstr(ch,find)==NULL)
printf("String Not Found");
else
printf("String Found");

getch();
}

Output:

* Program will display that string is found in main string or not.

--------------------------------------------------------------------------------
Explanation of C Programming Language Example # 24 Example : Find string inside a string

* Enter Your Main String
* Then enter string you want to find from main string.
* Program will display that string is exist or not..

Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements. 

No comments:

Post a Comment