solution of question 3
[SET – 1]

User-defined function in C++ to read the content from a text file OUT.TXT, count and display the number of alphabets present in it

 

void alphabets()
{
	ifstream fin;
	fin.open("out.txt");
	char ch;
	int count=0;
	while(!fin.eof())
	{
		fin.get(ch);
		if(isalpha(ch))
			count++;
	}
	cout<<"Number of alphabets in file are "<<count;
	fin.close();
}