C Program to Convert Uppercase String to Lowercase

In this program, we will take an upper case string as input from user and convert that into lowercase string

  1. //C program to convert string from upper case to lower case
  2. #include<stdio.h>
  3. #include<string.h>
  4. int main()
  5. {
  6. char str[50];
  7. int i;
  8. printf("Enter the string: ");
  9. scanf("%s",str);
  10. for(i=0;i<=strlen(str);i++){
  11. if(str[i]>=65&&str[i]<=90)
  12. str[i]=str[i]+32;
  13. }
  14. printf("\nLower Case is: %s",str);
  15. return 0;
  16. }

download android app

Popular C Examples


Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube