C Program to convert a string into its corresponding upper case format
The program given below will ask for a string as an input to the user and displays its corresponding uppercase format. No matter what cases of characters the string includes, this function will traverse them all character by character. And the function will hence convert them into their corresponding upper case form.
For understanding this topic more clearly you must have the prior knowledge of the following topics.
How to convert a string into its corresponding upper case in C?
Now, look at the following code to understand the implementation detail of the strupr() function.
Code:
#include<stdio.h> #include<string.h> int main(){ char n[100]; puts("Enter the string: "); gets(n); printf("String in the lowercase form is = %s",strupr(n)); }
Output:
HouSE
String in the lowercase form is = HOUSE