Answer:
Please see explaination for code and attachment for output
Step-by-step explanation:
The program source code.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fs("xy.txt");
char ch;
string str=""; // for storing characters
while(fs>>ch)
{
str=str+ch; // appending characters to string
}
int i=0,count=0;
while(str[i]!='\0')
{
if((str[i]>=65 && str[i]<=90)||(str[i]>=97 && str[i]<=122))
{
count++;
}
i++;
}
cout<<"No. of Alphabets:"<<count<<endl;
}
xy.txt:
Check attachment for output and code on screen.