#include<iostream>
#include<fstream>
using namespace std;
int main()
char str[20],ch,op;
ifstream in;
ofstream out;
// for characters
[Link]("[Link]");
do
cout<<"\n enter some character to write into the file::";
cin>>ch;
[Link](ch);
cout<<"\n continue enter y/Y::";
cin>>op;
}while(op=='y'||op=='Y');
[Link]();
[Link]("[Link]");
cout<<"\n entered characters are as follows\n";
while([Link](ch))
putchar(ch);
[Link]();
//for strings
[Link]("[Link]");
do
cout<<"\n enter some string to write into the file::";
cin>>str;
[Link]((char *)str,sizeof(str));
out<<"\n";
cout<<"\n continue enter y/Y::";
cin>>op;
}while(op=='y'||op=='Y');
[Link]();
[Link]("[Link]");
cout<<"\n entered characters are as follows\n";
while([Link]((char *)str,sizeof(str)))
puts(str);
[Link]();
return 0;