How do you change lowercase letters to uppercase letters in Rush C?

Updated on technology 2024-02-27
9 answers
  1. Anonymous users2024-02-06

    c To convert lowercase letters to uppercase letters, ** is as follows:

    #include

    using namespace std;

    void main(void)

    char i;

    cout<<"Enter lowercase letters'#'END:">i;

    if((i>=97)&&i<=122))

    i=i-32;

    cout break;

    The current program can input multiple lowercase letters at the same time, and can convert multiple lowercase letters into uppercase letters at the same time, the principle of this program is to input lowercase letters, subtract 32 from the ascii code of lowercase letters to convert them into uppercase letters, and when all lowercase letters are converted, it will jump out of the loop to end the program.

  2. Anonymous users2024-02-05

    First of all, I want to say that the letter should be of type char or string, otherwise how can it contain letters?

    It's very simple toupper(letter) is to replace all the letters of the letter variable with uppercase, and tolower(letter) is to make it lowercase, ok.

  3. Anonymous users2024-02-04

    #include

    using namespace std;

    const int n=5;

    void main()

    char a[n];

    cin>>a;

    char b[n];

    for(int i=0;ib[i]=char(int(a[i])-32);

    for( i=0;icout "But this program can only enter 5 characters.

    You can make some changes as needed.

    For example, change n=5 to the number of characters you want.

    Or to make a partial change is that it can enter arbitrary characters.

  4. Anonymous users2024-02-03

    In ASCII code, the uppercase letters are 32 smaller than the lowercase letters

  5. Anonymous users2024-02-02

    What type of letter is it?

    If it's char

    #include

    Use stupr (letter).

    If it is string, you can convert it to char first

    char str[1024];

    strcpy(str,letter = strupr(str);

  6. Anonymous users2024-02-01

    Informatics Olympiad 1138 - Converting lowercase letters in strings to uppercase letters.

  7. Anonymous users2024-01-31

    It is to convert uppercase letters into lowercase letters, and the difference between ASCII code values between uppercase and lowercase letters is 32, as long as it is determined that the uppercase letters increase by 32, it is a lowercase letter.

  8. Anonymous users2024-01-30

    Assuming that the uppercase variable to be converted is c and the variable where the result is stored is s, the ** of the conversion process is: s=c+'a'-'a'。

  9. Anonymous users2024-01-29

    If you convert the case of the letters, you can use the ASCII code The uppercase ascll of the letters is 32 smaller than the ascll code of the lowercase letters, and the number 32 can be directly subtracted.

Related questions
11 answers2024-02-27

It's textbox, right? textbook?

double somedouble; >>>More

13 answers2024-02-27

You save the path in an XML and read it out the next time you start it.

27 answers2024-02-27

You can pass the main window as a parameter to a child window. >>>More

8 answers2024-02-27

I've been thinking about similar questions, and I'd like to share my opinion: >>>More