In this program, you'll learn to convert a given string into lowercase letters.
#include<iostream>
using namespace std;
int main()
{
int i;
char str[20];
cout<<"Enter the string..\n";
gets(str);
for(i=0; str[i]!= '\0'; i++)
{
if(str[i] >= 'A' && str[i] <='Z')
{
str[i] = str[i] + 32;
}
}
cout<<"\nString in LOWERCASE is..\n";
puts(str);
return 0;
}
Enter the string..
I am very to learn code!
String in LOWERCASE is..
i am very to learn code!