OOCP4-4

//BCA Support //www.bcasupport.xyz #include <iostream.h> #include <conio.h> #include <fstream.h> int main() { clrscr(); ofstream fout("file.txt"); //open file for writing fout<<"BCA-Support\n"; //write BCA Support in file.txt fout<<"www.bcasupport.xyz"; //write www.bcasupport.xyz fout.close(); //close file ifstream fin("file.txt"); //open file for reading char line1[20],line2[20]; //strings for reading file text; fin>>line1; //read first line fin>>line2; //read second line cout<<line1<<endl<<line2; //print on screen fin.close(); //close file getch(); return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.