Practice

Occurences



Design and code a function named occurences() that returns the number of times that a search string appears within a reference string.  The search string is the first parameter of your function.  The reference string is the second parameter. 

The statements

 int i;

 i = occurences( "BT", "BTP100 BTO120" );
 printf("%d\n", i );

display

 2

The statements

 int i;

 i = occurences( "BB", "BBBXCBBb" );
 printf("%d\n", i );

display

 3 

  Top  Go Back to the Top of this Page



  Designed by Chris Szalwinski   Copying From This Site