strupr() function in C Programming Language

Rumman Ansari   Software Engineer   2019-03-31   7659 Share
☰ Table of Contents

Table of Content:


strupr() function converts a given string into uppercase. Syntax for strupr( ) function is given below.

Syntax

char *strupr(char *string);

Important Note

strupr() function is non standard function which may not available in standard library in C.

Program

In this program, string "atnyla want to convert in upper case" is converted into uppercase using strupr( ) function and result is displayed as ATNYLA WANT TO CONVERT IN UPPER CASE.


#include<stdio.h>
#include<string.h>
 
int main()
{
    char str[ ] = "atnyla want to convert in upper case";
    printf("%s\n",strupr(str));
    return  0;
}

Output

ATNYLA WANT TO CONVERT IN UPPER CASE
Press any key to continue . . .