convert a string to lowercase.

Description:

Write a program to convert a string to lowercase. Test Case 1 Input (stdin) ProGramminG Expected Output programming Test Case 2 Input (stdin) InDia Expected Output india

Program :

#include<iostream>

using namespace std;

int main( )

{

    char str[80];

   

    cin.getline(str, 80);

   

    for(int i=0;str[i]!='\0';i++)

    {

        str[i] = (str[i] >= 'A' && str[i] <= 'Z') ? (str[i] + 32) : str[i];

    }

    cout<<str << endl;

    return 0;

}