//Wap Using Functions that counts the number of occourances
//     of a pair of letters in a string.

#include
#include

int main()
{
clrscr();
char x,ch;
int count=0;
do{
clrscr();
char string[]="hello world how are you";
cout<> x;
for(int i=0;string[i]!='\0';i++)
{
	if(string[i]==x)
	{
	count++;
	}
}
cout << "\nThe character " <<"\"" <<  x << "\""<< " appears " << count << " times";
cout << " in " << "\"" << string << "\"";
cout << "\n\nDo you Want to try again(Y/N) : ";
cin >> ch;
} while (ch=='Y' || ch=='y');
getch();
return 0;
}

    Source: geocities.com/cplusplussurvivalkit