strupr(): String Upper Case (String Handling Function)

String handling function strupr() is used to convert all lower case letter in string to upper case i.e. strlwr(str) converts all lower case letter in string str to upper case.

strlwr() Syntax


strupr( string);

strlwr() Program


#include<stdio.h>
#include<string.h>

int main()
{
 char str[40];

 printf("Enter string:\n");
 gets(str);
 strupr(str);
 printf("String in uppercase is:");
 puts(str);
 
 return 0;
}

strlwr() Program Output


Enter string:
WeLcOmE To C 101. ↲
String in lowercase is:
WELCOME TO C 101.