[box]

Ans

void COUNT ()

{

ifstream File;

File. open (POEM.TXT);

char Word[80] ;

int Cl = 0, C2 = 0;

while(!File.eof())

{

File>>Word;

if (strcmp (Word, to) ==0)

Cl++;

else if (strcmp (Word, the) ==0)

C2++;

}

cout<<”Count of -to- in file:” <<Cl;

cout<<”Count of -the- in file:”<<C2;

File.close(); //Ignore

}

[/box]
Rate Us
error: Content is protected !!