C Programming Code Examples C > Conversions Code Examples C Program to convert uppercase string to lowercase string C Program to convert uppercase string to lowercase string In the following C program, user would be asked to enter a String (it can be in complete uppercase or partial uppercase) and then the program would convert it into a complete(all characters in lower case) lower case string. The logic we have used in the following program is: All the upper case characters (A-Z) have ASCII value ranging from 65 to 90 and their corresponding lower case characters (a-z) have ASCII value 32 greater than them. For example 'A' has a ASCII value 65 and 'a' has a ASCII value 97 (65+32). Same applies for other characters. #include<stdio.h> #include<string.h> int main(){ /* This array can hold a string of upto 25 chars, if you are going to enter larger string then increase the array size accordingly */ char str[25]; int j; printf("Enter the string: "); scanf("%s",str); for(j=0;j<=strlen(str);j++){ if(str[j]>=65&&str[j]<=90) str[j]=str[j]+32; } printf("\nLower Case String is: %s",str); return 0; }