Search This Blog

Thursday 21 April 2016

WAP in c++ to convert lowercase to uppercase from a file.

Practical 28



#include <iostream>
#include<fstream>
#include<string>
using namespace std;

int main()
{
    ifstream f;
f.open("test.txt");
string line;
while (!f.eof())
{
  f >> line;
  for (int j=0; j< line.length(); ++j)
  {
    line[j] = toupper(line[j]);
  }
  cout<<line<<endl;
     }

    return 0;
}

No comments:

Post a Comment