tolower in c 2b 2b

Solutions on MaxInterview for tolower in c 2b 2b by the best coders in the world

showing results for - "tolower in c 2b 2b"
Lottie
23 Jan 2019
1#include<bits/stdc++.h> 
2using namespace std; 
3main() { 
4    string s = "Viet Nam"; 
5    transform(s.begin(), s.end(), s.begin(), ::tolower); //lowercase
6    cout << s << endl; 
7}
8
Miley
05 Jan 2018
1#include <cctype>
2#include <iostream>
3#include <cstring>
4#include <cstdio>
5
6using namespace std;
7
8int main()
9{
10    char str[] = "John is from USA.";
11
12    cout << "The lowercase version of \"" << str << "\" is " << endl;
13
14    for (int i=0; i<strlen(str); i++)
15        putchar(tolower(str[i]));
16    
17    return 0;
18}