Friday, 26 January 2018

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

#include<iostream>
#include<fstream>
#include<cctype>
using namespace std;
main()
{
    int j=0;
    char a[100];
    fstream i;
    i.open("FILE.txt",ios::in );
    while(i)
    {
        i.get(a[j]);
        a[j]=toupper(a[j]);
        j++;
    }
    a[j-1]='\0';
    cout<<a;
    i.close();
    i.open("FILE.txt",ios::out);
    j=0;
    while(a[j]!='\0')
    {
        i.put(a[j++]);
    }
    i.close();
}

No comments:

Post a Comment

It's time To increase blogging capability. To have a chance to contribute in digital world. Any Interested People who want to make t...