Computer Science, asked by mohit551050, 9 months ago

write a program in c++ to count number of words in c++ !! only right answer otherwise I'll report and not copied!⚠️⚠️​

Answers

Answered by Anonymous
2

\tt\it\bf\it\Large\bm{\mathcal{\fcolorbox{blue}{white}{\blue{PROGRAM:-}}}}

_____________________________

# include<fstream.h>

#include<conio.h>

void main( )

{

clrscr( );

ifstream fin;

fin.open("out.txt");

char word[30];

int count = 0;

while ( ! fin.eof( ) )

{

fin>>word;

count++;

}

cout<<"Number of words in file is ";

cout<<count;

fin.close( );

getch( );

}

}____________________________

hope it helps ✌️✌️

Similar questions