- strupr( ) function converts a given string into uppercase. Syntax for strupr( ) function is given below.
char *strupr(char *string);
- strupr( ) function is non standard function which may not available in standard library in C.
Example program for strupr() function in C:
- In this program, string ”Modify This String To Upper” is converted into uppercase using strupr( ) function and result is displayed as “MODIFY THIS STRING TO UPPER”.
#include<stdio.h> #include<string.h> int main() { char str[ ] = "Modify This String To Upper"; printf("%s\n",strupr(str)); return 0; }
Output:
MODIFY THIS STRING TO UPPER
|
0 comments:
Post a Comment