C program for strupr() function.

In C language, strupr() function is used to convert characters of string in to upper case .This function is defined in Header File <string.h>.The result is stored in the same input string. it does not affect numbers, operators and special symbols of string.
सी लैंग्वेज में strupr() फंक्शन का प्रयोग स्ट्रींग के अल्फाबेट्स को अपर केस में परिवर्तित करने के लिए किया जाता है। यह फंक्शन string.h हैडर फाइल में परिभाषित है।

Syntax:-
char* strupr("string");
char* strupr(char* string);

Example:-
char a[10]="CoMPuTer";
strupr(a);

Output:-
a=COMPUTER

C Program for strupr() :-

#include<stdio.h>
#include<conio.h>
#include<string.h>
main() {
char s[255];
clrscr();
printf("Enter a string\n");
gets(s);
strupr(s);
printf("String in upper case = %s\n",s);
getch();
return 1;
}

Output:-
Enter a string
@$IndORe123
String in lower case = @$INDORE123

Comments

Popular posts from this blog

C Language Topics in Hindi and English

C language IMP Questions for BSc/BA/BCom/BCA/BE/BTech/MSc/MCA (CS/IT) I year students