answersLogoWhite

0


Best Answer

#include<iostream>

#include<fstream>

#include<string>

int main()

{

size_t count=0;

std::string vowels ("aeiouAEIOU");

std::ifstream ifs;

ifs.open ("test.txt", std::ios::in);

if (ifs.bad())

{

ifs.close();

std::cerr << "Invalid input file.\n" << std::endl;

return;

}

while (!ifs.eof())

{

char c = ifs.get();

if ((c>='a' && c<='z') (c>='A' && c<='Z'))

if (vowels.find (c) != vowels.npos)

++count;

}

ifs.close();

std::cout << "The file has " << count << " non-vowels.\n" << std::endl;

}

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C plus plus programme to count non-vowels in a file of test?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write java programme to find sum of 13 plus 23 plus 33 plus .up to193?

class ass{ public static void main(String[] args ){ int 13,33,23,...193 sum = 0; for (count = 0; count&lt;=193; count++); { sum=sum+count; System.out.print(count + "sum"); }System.out.println("sum is"+sum);


What are the steps to execute a c plus plus programme?

Build it, link it, run it.


Make programme for multification of three no in c plus plus?

result = a * b * c;


Is there a file concept in c plus plus?

No. The standard does not define nor require a file concept.


How do you create .exe file in c plus plus?

You can create an exe-file from your C++ source, if you have a compiler.


How do you write a programme to print a plus bi in c plus plus?

#include &lt;iostream&gt; int main() { std::cout &lt;&lt; "a plus bi" &lt;&lt; std::endl; return 0; }


How do you open a file in c plus plus?

fopen()


Which function is used to determine the position of the put pointer in a file in c plus plus?

The function ftell returns the position of the file pointer for a file.


What is step involve is using data file in c plus plus programming?

Declaration of file pointer opening of file in desired mode. performing the desired operation. closing the file


How do you concatinate two files in c plus plus?

Copy the first file then append the second file to the copy.


C plus plus reading and writing a file?

Use an input file stream (ifstream) to read from a file and an output file stream (ofstream) to write to a file. Both can be found in the &lt;fstream&gt; standard library header.


What is a scatter file in c or c plus plus programming?

Scatter File is a linker script file used by RVCT/Keil for ARM processors. It is used by arm linker.