#include<fstream.h> #include<iostream.h> #include<conio.h> #include<stdio.h> #include<process.h> #include<ctype.h> void main() { clrscr(); int n,choice, flag; fstream file1,file2; char str[256]; char ch; do { clrscr(); cout<<"\n---MENU---\n1.Write text to the first file" <<"\n2.Read text from first file\n3.Write vowels to the second file" <<"\n4.Display the second file\n5.Exit"; cout<<"\nEnter your choice : "; cin>>choice; switch(choice) { case 1: file1.open("smp1.txt",ios::out); cout<<"\nEnter the text : "; gets(str); file1<<str; file1.close(); cout<<"\nFile1 Created successfully"; break; case 2: file1.open("smp1.txt",ios::in); while(file1) { file1.get(ch); cout<<ch; } file1.close(); break; case 3: file1.open("smp1.txt",ios::in); file2.open("smp2.txt",ios::out); while(file1.eof()==0) { file1.get(ch); if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U') file2.put(ch); } file1.close(); file2.close(); cout<<"\nFile 2 is created with vowels from File 1"; break; case 4: file2.open("smp2.txt",ios::in); cout<<"\nLower case vowels : "; flag=0; while(file2) { file2.get(ch); if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u') { cout<<ch; flag=1; } } if(flag==0) cout<<"\nNo lower case vowels"; cout<<"\nUpper case vowels : "; flag=0; file2.close(); file2.open("smp2.txt",ios::in); while(file2) { file2.get(ch); if(ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U') { cout<<ch; flag=1; } } if(flag==0) cout<<"\nNo upper case vowels"; break; case 5: exit(0); default: cout<<"\nWrong choice!!!"; break; } cout<<"\nPress any key to continue"; getch(); } while(1); }
Menu driven C++ program for writing, reading a file and writing vowels in another file
Subscribe to:
Post Comments (Atom)
This blog is really great.This site is very helpful and informational : click here
ReplyDeleteIEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Projects for CSE It gives you tips and rules that is progressively critical to consider while choosing any final year project point.
DeleteJavaScript Online Training in India
JavaScript Training in India
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Great blog.you put Good stuff.All the topics were explained briefly.so quickly understand for me.I am waiting for your next fantastic blog.Thanks for sharing.Any coures related details learn...
ReplyDeleteJava Training in Bangalore|
I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site"Devops Training in Chennai"
ReplyDeleteIt’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
ReplyDeleteI’ve bookmarked your site, and I’m adding your RSS feeds to my Google account.
java training in bangalore
I have to voice my passion for your kindness giving support to those
ReplyDeletepeople that should have guidance on this important matter.
Selenium Training in Bangalore
Hey, I just want to ask, are you using word press for this website? It's super smooth and easy to use! By the way, if you need to register a business, let me know, I know the best business incorporation, register a business now!
ReplyDeleteIn the free version File hosterz, some features such as the parallel downloads or the download speed is only very limited use. But even with the free version you can upload files up to 2GB. The memory is unlimited here. In addition, the remote upload function can be used free of charge
ReplyDeleteOn the one hand File hosterz, the free version, in which the functions such as download speed or parallel downloads are limited. On the other hand, the premium version, which is available in different terms. At the terms you can add depending on your desire traffic.
ReplyDeleteGood Post..Mat Lab Projects Center in Chennai | Mat Lab Projects Center in Velachery
ReplyDeleteAppreciation for really being thoughtful and also for deciding on certain marvelous guides most people really want to be aware of.
ReplyDeleteAWS Training in Chennai
The best place to learn C programming with an ease. Thanks for posting useful info...
ReplyDeleteBest Online Software Training Institute | C++ Training
Informative blog ... Thnq for sharing your thoughts with us .. keep going..
ReplyDeleteSelenium training | Selenium training in chennai
Very useful info. Thanks.
ReplyDeleteSelenium Training in Chennai | Selenium Training
online stumbled upon online casino advertising, all kinds of slot machines And I was glad to click on the link to see such a cool design and everything is clear where and how to play and what to press merely online casino now this is my favorite site
ReplyDeleteAmazing post thanks for sharing
ReplyDeleteBest DevOps Training in Chennai
Have been a long wait for this blog. Happy on reading. Do share more of this kind.
ReplyDeleteSpoken English Classes in Chennai
Spoken English Class in Chennai
Spoken English in Chennai
Best Spoken English Classes in Chennai
Best Spoken English Institute in Chennai
Thanks Admin For sharing this massive info with us. it seems you have put more effort to write this blog , I gained more knowledge from your blog. Keep Doing..
ReplyDeleteRegards,
RPA Training in Chennai
RPA Classes in Chennai
CCNA Training in Chennai
DevOps Training in Chennai
SEO Training in Chennai
RPA Training in OMR
RPA Training in Velachery
RPA Training in Tambaram
Great Blog!!! Nice to read... Thanks for sharing with us...
ReplyDeleteembedded systems training in coimbatore
Embedded course in Coimbatore
embedded training in coimbatore
PHP Course in Madurai
Spoken English Class in Madurai
Selenium Training in Coimbatore
SEO Training in Coimbatore
Web Designing Course in Madurai
Great work. Quite a useful post, I learned some new points here.I wish you luck as you continue to follow that passion.
ReplyDeleteDevops Training in Chennai | Devops Training Institute in Chennai
Thanks for posting this. Its really informative.
ReplyDeleteGerman Classes in Chennai
German Training in Chennai
IELTS Coaching in OMR
TOEFL Coaching Centres in Chennai
french classes
pearson vue
German Courses in Chennai
German classes in Anna Nagar
I appreciate you for this blog. More informative, thanks for sharing with us.
ReplyDeleteSalesforce Training in Chennai
salesforce training in bangalore
Salesforce Course in Bangalore
best salesforce training in bangalore
salesforce institute in bangalore
salesforce developer training in bangalore
Python Training in Bangalore
Angularjs Training in Bangalore
salesforce training in marathahalli
salesforce institutes in marathahalli
Very informative post and it was quite helpful to me.
ReplyDeleteAWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery
this teacher page having nice content..Great work. Quite a useful post, I learned some new points here.I wish you luck as you continue to follow that passion.keep update
ReplyDeleteAngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery
Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging.
ReplyDeleteSalesforce Training in Chennai
Salesforce Online Training in Chennai
Salesforce Training in Bangalore
Salesforce Training in Hyderabad
Salesforce training in ameerpet
Salesforce Training in Pune
Salesforce Online Training
Salesforce Training
I like the helpful info you supply in your articles. I’ll bookmark your weblog and take a look at once more here regularly. I am relatively certain I will learn a lot of new stuff right here! Good luck for the following!
ReplyDeleteangular js training in chennai
angular js training in velachery
full stack training in chennai
full stack training in velachery
php training in chennai
php training in velachery
photoshop training in chennai
photoshop training in velachery