Computer Science, asked by keshavprajapati8238, 1 year ago

Write a c++ program to display number of vowels present in a given file

Answers

Answered by Anonymous
2
#include<fstream> #include<iostream> using namespace std; int main() { char ch; int vowelCount=0; fstream file; file.open("cards.txt");//opens the file name cards.txt while(!file.eof()) { if(ch=='a') vowelCount++; //increments the counter if found 'a' } file<<vowelCount; //outputs the value of vowelcounter into the cards.txt file file.close(); return 0; }
Similar questions