Write a program to convert a string in lowercase
Write a C++ Program to Convert a String in Lowercase
Object: Write a program to convert a string in lowercase. C++ Projects. C++ projects for beginners with source code
Code:
#include<iostream>
#include<conio.h>
#include<string>
using namespace std;
void main()
{
string tex;
int i;
cout<<“Enter the text in Upper case: “;
getline(cin,tex);
for(i=0;i<tex.length();i++)
{
tex[i]=tolower(tex[i]);
}
cout<<“Lower case is :”<<tex;
getch();
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include<iostream> #include<conio.h> #include<string> using namespace std; void main() { string tex; int i; cout<<"Enter the text in Upper case: "; getline(cin,tex); for(i=0;i<tex.length();i++) { tex[i]=tolower(tex[i]); } cout<<"Lower case is :"<<tex; getch(); } |
1 Response
[…] Write a program to convert a string in lowercase […]