user104084
6
Q:

tolower in c++

// Include #include<bits/stdc++.h>
string s = "Jatin Goyal"; 
// using transform() function and ::tolower in STL 
transform(s.begin(), s.end(), s.begin(), ::tolower); 
3
#include <cctype>
#include <iostream>
#include <cstring>
#include <cstdio>

using namespace std;

int main()
{
    char str[] = "John is from USA.";

    cout << "The lowercase version of \"" << str << "\" is " << endl;

    for (int i=0; i<strlen(str); i++)
        putchar(tolower(str[i]));
    
    return 0;
}
2

New to Communities?

Join the community