Program 1 :
#include#include #include void main() { char *string = "Pritesh Taral"; printf("String before to strupr : %sn", string); strupr(string); printf("String after strupr : %sn", string); getch(); }
Output :
String before to strupr : Pritesh Taral String after strupr : PRITESH TARAL
Program 2 :
#include#include #include void main() { char string[100]; printf("Enter String : "); gets(string); strupr(string); printf("String after strupr : %sn", string); getch(); }
Output :
Enter String : Pritesh Taral String after strupr : PRITESH TARAL
Explain me ?
- strupr : Converts all Letters from given String into equivalent Uppercase Letters
- Uppercase Letters Remains as It is .
- Digits and Spaces also remains same , only lowercase letter gets modified.
- strlwr functions is included in Header File : string.h
No comments:
Post a Comment