Write a program that reads a text file and creates another text file that is identical except that every letter must be converted to lower case irrespective of its original case. (e.g. ‘a’ or ‘A’ will become ‘a’).
Code :
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<string.h>
void main()
{
clrscr();
char c[100];
ofstream f1("File3.txt");
cout<<"Enter String : ";
cin.getline(c,100);
f1<<c;
f1.close();
ifstream f2("File3.txt");
f2.getline(c,50);
strlwr(c);
cout<<"Lowercase :- "<<c<<endl;
f2.close();
ofstream f3("File4.txt");
f3<<c;
f3.close();
getch();
}
Output :
No comments:
Post a Comment