Convert String Characters in Uppercase and Lowercase C Program

By | August 18, 2016

C Program To Convert String Characters in Uppercase and Lowercase

Learn How To Convert String Characters in Uppercase and Lowercase. This C Code makes use of ASCII values of the characters in C Programming. Before proceeding with this program, you must understand ASCII Value Conversion.

This C Program takes a String as Input from the User and converts the Lowercase characters into Uppercase and Uppercase characters into Lowercase. This code scans every element of the string. If the element is in lowercase, it is converted to uppercase by decreasing its value by 32. If the element in the string is in uppercase, it is converted into lowercase by increasing its value by 32.

The first method makes use of ASCII Value Conversion whereas the second method to Convert String Characters Cases from Lowercase to Uppercase using String Functions tolower() and toupper() methods. These string methods are defined in the header file ctype.h.

Must Read: C Program To Print Fibonacci Series

C Program To Convert String Characters From Uppercase To Lowercase and Vice-Versa

 

Must Read: C Program To Implement Trapezoidal Rule

Convert String Character from Lowercase To Uppercase in C Programming using Library Function

 

Must Read: C Program To Convert Characters from Uppercase To Lowercase and Vice – Versa

Output

Convert String Characters from uppercase to lowercase and vice - versa

In case you get any Compilation Errors or have any doubts in this C Program For Conversion of String Characters Cases (Uppercase and Lowercase), let us know about it in the Comment Section below.

2 thoughts on “Convert String Characters in Uppercase and Lowercase C Program

  1. Vijay Yadav

    Thank you so much for this String program to convert uppercase letters to lowercase and simultaneously lowercase letters to uppercase. I was very much confused with this one. I feel tolower and toupper functions are easy compared to the ascci value comparisons.

    Reply
    1. Tushar Soni Post author

      Obviously, functions are made to simplify the things. But, if you understand the ASCII Values and corresponding comparisons, it would be much simpler for you to implement in your User Defined functions in future.

      Reply

Let's Discuss