Advertisement
sahajjain01

Create file containing lower case vowels from another file

Jul 24th, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. //Program that reads a file first.txt and creates a new file second.txt which contains only those words from first.txt which starts from lower-case vowels.
  2. /*first.txt:-
  3. The C++ is a the general purpose the programmingthe language.
  4. An appple a day keeps the doctor away.
  5. History repeats itself.
  6. All that glitters is not gold.
  7. If life deals you lemons, make lemonade.
  8. */
  9.  
  10. #include<iostream.h>
  11. #include<conio.h>
  12. #include<fstream.h>
  13. #include<ctype.h>
  14. void main()
  15. {
  16.     clrscr();
  17.  
  18.     char a[80];
  19.     ifstream ifile("first.txt");
  20.  
  21.     ofstream ofile("second.txt");
  22.  
  23.     while(!ifile.eof())
  24.     {
  25.         ifile>>a;
  26.         if((a[0]=='a')||(a[0]=='e')||(a[0]=='i')||(a[0]=='o')||(a[0]=='u'))
  27.         ofile<<a;
  28.     }
  29.     getch();
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement