Write a C++ function to count the number of lowercase alphabets present in "NOTES.TXT”. file.

void countLower()
{
ifstream fin(“NOTES.TXT”);
char ch;
int count=0;
while(!fin.eof())

fin.get(ch);
if (islower(ch))
count++;
}
fin.close();
cout<<"There are "<<count<<" lower case letters in NOTES.TXT file.";
}

void main()
{
  countLower();
}




No comments

Post your comments

Powered by Blogger.