Q:

Write a C++ program to replace all the lower-case letters of a given string with the corresponding capital letters

0

Write a C++ program to replace all the lower-case letters of a given string with the corresponding capital letters

Sample Output:

Sample Input 
the quick brown fox jumps over the lazy dog. 
sample Output
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    string text;
    getline(cin, text);
    transform(text.begin(), text.end(), text.begin(), ::toupper);
    cout << text << endl;
    return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now