C Program to convert uppercase string to lowercase string

#include<stdio.h>
#include<string.h>
int main(){
   /* This array can hold a string of upto 26
    * chars, if you are going to enter larger string
    * then increase the array size accordingly
    */
   char str[26];
   int i;
   printf("Enter the string: ");
   scanf("%s",str);
 
   for(i=0;i<=strlen(str);i++){
      if(str[i]>=65&&str[i]<=90)
         str[i]=str[i]+32;
   }
   printf("\nLower Case String is: %s",str);
   return 0;
}

One thought on “C Program to convert uppercase string to lowercase string

Comments are closed.