OneCompiler

C++ program to convert given string to upper case

204

The following C++ program transforms the given string to uppercase using toupper

#include<bits/stdc++.h>
using namespace std;
  
int main()
{
    string su = "This is string";
    transform(su.begin(), su.end(), su.begin(), ::toupper);
    cout << su << endl;

    return 0;
}

Output:

THIS IS STRING

Try it Online here https://onecompiler.com/cpp/3x73sd8wp