//C++ program to write and read values using variables in/from file.
using namespace std;
cout<<"Error in creating file.."<<endl;
cout<<"\nFile created successfully."<<endl;
//read values from kb
cout<<"Enter your name: ";
cout<<"Enter age: ";
//write into file
cout<<"\nFile saved and closed succesfully."<<endl;
//re open file in input mode and read data
cout<<"Error in opening file..";
File created successfully.
Enter your name: Mike
Enter age: 21
File saved and closed succesfully.
total answers (1)
start bookmarking useful questions and collections and save it into your
own study-lists, login now to start creating your own collections.