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. }

Output


Output!