#include<iostream>
#include<fstream>
using namespace std;
int main()
{
ofstream myfile("t1.txt");
char c[100];
int a;
cout<<"enter your number :";
cin>>a;
cout<<endl<<"enter your First Name:";
cin.getline(c,100);
myfile<<a<<endl<<c;
myfile.close();
ifstream myfile1("t1.txt");
char d[100];
int b;
myfile1>>b>>d;
cout<<endl<<"your number is:"<<b<<endl;
cout<<"your First Name:"<<d;
myfile1.close();
return 0;
}
#include<fstream>
using namespace std;
int main()
{
ofstream myfile("t1.txt");
char c[100];
int a;
cout<<"enter your number :";
cin>>a;
cout<<endl<<"enter your First Name:";
cin.getline(c,100);
myfile<<a<<endl<<c;
myfile.close();
ifstream myfile1("t1.txt");
char d[100];
int b;
myfile1>>b>>d;
cout<<endl<<"your number is:"<<b<<endl;
cout<<"your First Name:"<<d;
myfile1.close();
return 0;
}
No comments:
Post a Comment