Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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.
- /*first.txt:-
- The C++ is a the general purpose the programmingthe language.
- An appple a day keeps the doctor away.
- History repeats itself.
- All that glitters is not gold.
- If life deals you lemons, make lemonade.
- */
- #include<iostream.h>
- #include<conio.h>
- #include<fstream.h>
- #include<ctype.h>
- void main()
- {
- clrscr();
- char a[80];
- ifstream ifile("first.txt");
- ofstream ofile("second.txt");
- while(!ifile.eof())
- {
- ifile>>a;
- if((a[0]=='a')||(a[0]=='e')||(a[0]=='i')||(a[0]=='o')||(a[0]=='u'))
- ofile<<a;
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement