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

Rumman Ansari   Software Engineer   2024-07-05 04:32:10   8108  Share
Subject Syllabus DetailsSubject Details
☰ TContent
☰Fullscreen

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


Stay Ahead of the Curve! Check out these trending topics and sharpen your skills.