Convert String into Uppercase C Program

By | August 19, 2016

C Program To Convert String into Uppercase Characters

Learn How To Convert String into Uppercase Characters in C Programming Language. This C Program demonstrates the use of Library Functions toupper() method.

The toupper() method is defined in the ctype.h header file. The strlen() method is defined in the string.h header file.  The second method makes use of ASCII value conversion. The toupper() method converts the character into its corresponding Uppercase letter.

Must Read: C Program To Remove Vowels from String

C Program To Convert String into Uppercase using Library Functions

Must Read: C Program For Conversion of String into Lowercase Characters

 

C Program For String Conversion into Uppercase without toupper() method (ASCII Values)

Must Read: C Program To Convert String Character From Uppercase To Lowercase and Vice versa

 

Output

C Program To Convert String into Uppercase Characters without toupper method

In case you get any Compilation Errors or any doubts in this C Program To Convert String into Uppercase letters with and without String Library Functions, let us know about it in the Comment Section below.

2 thoughts on “Convert String into Uppercase C Program

  1. Ajay Mishra

    Is it necessary to use strlen method to find the length of the string? Can’t we use the array limit 100 in the for loop instead of using length?

    Reply
    1. Tushar Soni Post author

      Hi Ajay! You can use the limit of array which is 100 in this program. But, instead of incrementing the For Loop till 100, you can reduce the execution time by incrementing the counter variable in the for loop till the String’s Length. If the String’s length is only 20, the loop will go till 100 which is a waste of time and space. The strlen() method will automatically fetch the exact length even if it is 90 (still saving you from 9 loops).

      Reply

Let's Discuss