C++ Program to count number of times for the appearance of word "do".

How to count number of times for the appearance of word "do" in C++ Programming ?

How to count number of times for the appearance of word "do" in C++ Programming ? Program to count number of times for the appearance of word "do".
Count the number of occurrences of a word 

//Program to count number of times for the appearance of word "do".

#include<fstream.h>
#include<conio.h>
#include<ctype.h>
#include<string.h>
void main()
{
clrscr();
int count=0;
char a[10];

ofstream ofile("file.txt");
ofile<<"do re me fa so la ti do do re me fa so la ti do do re me fa so la ti do";
ofile.close();

ifstream ifile("file.txt");
while(!ifile.eof())
{
ifile>>a;
if(strcmp(a,"do")==0)
count++;
}
cout<<count;
getch();
}

This C++ Program is: To count number of times for the appearance of word "do".


Learn More :