Sunday, 26 April 2015

U7P1

Write a program that reads a text file and creates another file that is identical except that every character is in upper case.

Code :
 #include<iostream.h>  
 #include<conio.h>  
 #include<fstream.h>  
 #include<string.h>  
 void main()  
 {  
      clrscr();  
      char c[100];  
      ofstream f1("File1.txt");  
      cout<<"Enter String : ";  
      cin.getline(c,100);  
      f1<<c;  
      f1.close();  
      ifstream f2("File1.txt");  
      f2.getline(c,50);  
      strupr(c);  
      cout<<"UPPERCASE :- "<<c<<endl;  
      f2.close();  
      ofstream f3("File2.txt");  
      f3<<c;  
      f3.close();  
      getch();  
 }  

Output :

No comments:

Post a Comment