C Program To Convert Uppercase and Lowercase Characters
Learn How to Convert Uppercase and Lowercase Characters in C Programming Language. We have used two Methods for Character conversion. The First method uses Library Function tolower() and toupper() whereas the Second method deals with conversion of ASCII values of the characters.
Also Read: C Program To Find if a Character is Lowercase or Uppercase
The First method consists of Built-In Library Functions such as tolower() and toupper() which are declared under <ctype.h> Header file. The Second Method checks Characters for its Case by using ASCII Values.
Method 1: C Program To Convert Uppercase and Lowercase Characters using Library Function
1 2 3 4 5 6 7 8 9 10 11 12 13 | #include<stdio.h> #include<ctype.h> int main() { char ch; printf("\nEnter A Character:\t"); scanf("%c", &ch); printf("\nCharacter in Upper Case:\t%c", toupper(ch)); printf("\nCharacter in Lower Case:\t%c", tolower(ch)); printf("\n"); return 0; } |
Method 2: C Program To Convert Characters using ASCII Values
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include<stdio.h> int main() { char ch; printf("\nEnter A Character:\t"); scanf("%c", &ch); if(ch >= 65 && ch <= 90) ch = ch + 32; else if(ch >= 97 && ch <= 122) ch = ch - 32; printf("\nConverted Case:\t %c", ch); printf("\n"); return 0; } |
Also Read: C Program Code To Check Character is Alphabet or Digit
Output

Also Read: C Program To Check ASCII Values and Character
If you have any compilation errors or doubts in this C Program To Convert Lowercase and Uppercase Letters using ASCII Values, let us know about in the Comment Section below.