Table of Contents

    Convert String to Uppercase in C: strupr() function in C Programming Language

    Convert String to Uppercase in C: strupr() function in C Programming Language

    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 . . .