Convert String to Lower Case – C Program

Convert String to Lower Case – C Program

write a c program to convert given string to lower case letter.

#include<stdio.h>
#include<conio.h>

void main()
{
 char str[100];
 int i;
 printf("Please, Enter the String = ");

 gets(str);


 for(i=0;str[i]!=NULL;i++)
 {
  if(str[i]>='A'&&str[i]<='Z')
    {
      str[i]+=32;
    }
}
 
 printf("\nThe Lower Case String = %s",str);

}

The output of lower case string is :

Please, Enter the String = MEERA

The Lower Case String = meera

 

Author: Meera Academy

Leave a Reply

Your email address will not be published. Required fields are marked *