Вы находитесь на странице: 1из 2

#include<fstream.

h>
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
void main()
{
clrscr();
char s[100];
ofstream fout("first.txt");
char ans='y';
while((ans=='y' || ans=='Y'))
{
cout<<" Enter string to be written ";
gets(s);
fout<<s<<"\n";
cout<<" Want to continue ";
cin>>ans;
}
char ch;
fout.close();
ifstream infile;
infile.open("first.txt");
fout.open("second.txt");
while(!infile.eof())
{

infile.get(ch);
ch=toupper(ch);
fout<<ch;
cout<<ch;
}
infile.close();
fout.close();
getch();
}

Вам также может понравиться