Count Number Of Alphabets

#include<iostream>
#include<fstream>
#include<conio.h>

using namespace std;

void main()
{
    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();
getch();
}

No comments:

Post a Comment