Solved programming problem

Convert a string to lowercase in C.

Source code

#include <stdio.h>

int main()

{

    char str[100];

    int i;

    printf("Please Enter Massage: ");

    gets(str);

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

    {

        if(str[i]>='A' && str[i]<='Z')  ///checking if the alphabet is Uppercase or not

        {

            str[i]=str[i]+32;   /// making lowercase alphabet

        }

    }

    printf("
Your Massage is: %s
",str);

    return 0;

}

Output

Please Enter Massage: CODE TO HAVEN

Your Massage is: code to haven

Join the discussion

Add your comment

1 previous comment

test

test