#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
ReplyDeleteGreat 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"
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
ReplyDeleteGood Post..Mat Lab Projects Center in Chennai | Mat Lab Projects Center in Velachery
ReplyDeleteThe 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
Amazing post thanks for sharing
ReplyDeleteBest DevOps Training in Chennai
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
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
Excellent Submit, Very Informative. I’m Wondering Why VT Markets Opposite Specialists Of This Sector Don’t Realize This. You Should Continue Your Writing. I’m Confident, You Have A Great Readers’ Base Already!
ReplyDeleteSmm panel
ReplyDeletesmm panel
iş ilanları
instagram takipçi satın al
hirdavatciburada.com
beyazesyateknikservisi.com.tr
servis
tiktok hile
The NoteZilla Crack is a highly functional calendar and task manager as well. Once you've organized them, they can be categorized.Notezilla Portable
ReplyDeleteAdobe Master Collection CC 2022 is a collection of applications from the Creative Cloud 2022 line and several junior version programs combined by a single .Adobe CC 2022 System Requirements
ReplyDeleteMarch 20, 2022 by Admin The wishes we have provided here for Christmas and new year are very new and are updated very recently.Formal Christmas Wishes
ReplyDeleteNice article. Thanks for sharing.
ReplyDeleteC & C++ course in Pune