/*PRGRAM TO COUNT OCCURANCE OF A PATICILAR WORD …



/* 6.1 PROGRAM TO COUNT OCCURANCE OF A PATICILAR WORD IN A STATEMENT*/

import java.io.*;

class searchword

{

public static void main(String args[ ])

{

String str = new String();

String search = new String();

int i,len1,len2,index=-1,count=0;

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

try

{

System.out.print("Enter String : ");

str = in.readLine();

System.out.print("Enter a word to be searched in string : ");

search = in.readLine();

}

catch(Exception e)

{

System.out.println("I/O Error");

}

len1 = str.length();

len2 = search.length();

for(i=0;i ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download